@@ -296,7 +296,8 @@ |
||
| 296 | 296 | // the tree. This is, for example, used by the on-delete cache invalidation. |
| 297 | 297 | try { |
| 298 | 298 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 299 | - } catch (midcom_error $e) { |
|
| 299 | + } |
|
| 300 | + catch (midcom_error $e) { |
|
| 300 | 301 | debug_add("Could not load GUID {$guid}, trying to continue anyway. Last error was: " . $e->getMessage(), MIDCOM_LOG_WARN); |
| 301 | 302 | } |
| 302 | 303 | if (!empty($object)) { |
@@ -260,10 +260,12 @@ discard block |
||
| 260 | 260 | && !isset(self::$_nodes[$parent_id])) { |
| 261 | 261 | try { |
| 262 | 262 | self::$_nodes[$parent_id] = $this->_loadNodeData($parent_id); |
| 263 | - } catch (midcom_error_forbidden $e) { |
|
| 263 | + } |
|
| 264 | + catch (midcom_error_forbidden $e) { |
|
| 264 | 265 | debug_add("The Node {$parent_id} is invisible, could not satisfy the dependency chain to Node #{$node_id}", MIDCOM_LOG_WARN); |
| 265 | 266 | return $e->getCode(); |
| 266 | - } catch (midcom_error $e) { |
|
| 267 | + } |
|
| 268 | + catch (midcom_error $e) { |
|
| 267 | 269 | return $e->getCode(); |
| 268 | 270 | } |
| 269 | 271 | |
@@ -287,7 +289,8 @@ discard block |
||
| 287 | 289 | |
| 288 | 290 | try { |
| 289 | 291 | self::$_nodes[$node_id] = $this->_loadNodeData($topic_id); |
| 290 | - } catch (midcom_error $e) { |
|
| 292 | + } |
|
| 293 | + catch (midcom_error $e) { |
|
| 291 | 294 | return $e->getCode(); |
| 292 | 295 | } |
| 293 | 296 | return MIDCOM_ERROK; |
@@ -52,7 +52,8 @@ |
||
| 52 | 52 | } elseif (!empty($this->data[MIDCOM_NAV_GUID])) { |
| 53 | 53 | try { |
| 54 | 54 | $this->data[MIDCOM_NAV_OBJECT] = midcom::get()->dbfactory->get_object_by_guid($this->data[MIDCOM_NAV_GUID]); |
| 55 | - } catch (midcom_error $e) { |
|
| 55 | + } |
|
| 56 | + catch (midcom_error $e) { |
|
| 56 | 57 | } |
| 57 | 58 | } else { |
| 58 | 59 | debug_add("Warning: The leaf {$this->leafid} of topic {$topic->id} does set neither a GUID nor an object."); |
@@ -658,7 +658,8 @@ |
||
| 658 | 658 | && mgd_is_guid($guid)) { |
| 659 | 659 | try { |
| 660 | 660 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 661 | - } catch (midcom_error $e) { |
|
| 661 | + } |
|
| 662 | + catch (midcom_error $e) { |
|
| 662 | 663 | debug_add("Failed to create a metadata instance for the GUID {$guid}: " . $e->getMessage(), MIDCOM_LOG_WARN); |
| 663 | 664 | debug_print_r("Source was:", $source); |
| 664 | 665 | |
@@ -69,7 +69,8 @@ |
||
| 69 | 69 | // Use the DB Factory to resolve the class and to get the object |
| 70 | 70 | try { |
| 71 | 71 | $object = midcom::get()->dbfactory->get_object_by_guid($identifier); |
| 72 | - } catch (midcom_error $e) { |
|
| 72 | + } |
|
| 73 | + catch (midcom_error $e) { |
|
| 73 | 74 | // This is probably a pseudo leaf, store the score to the current node |
| 74 | 75 | $this->_topic->set_parameter('midcom.helper.nav.score', $identifier, $score); |
| 75 | 76 | return true; |
@@ -132,7 +132,8 @@ |
||
| 132 | 132 | && $nodeobject = $nav->get_node($node->id)) { |
| 133 | 133 | $napobject = $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id); |
| 134 | 134 | } |
| 135 | - } catch (midcom_error $e) { |
|
| 135 | + } |
|
| 136 | + catch (midcom_error $e) { |
|
| 136 | 137 | $e->log(); |
| 137 | 138 | } |
| 138 | 139 | return $napobject; |
@@ -72,7 +72,8 @@ |
||
| 72 | 72 | |
| 73 | 73 | try { |
| 74 | 74 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 75 | - } catch (midcom_error $e) { |
|
| 75 | + } |
|
| 76 | + catch (midcom_error $e) { |
|
| 76 | 77 | debug_add("Failed to resolve the GUID {$guid}, this is most probably an access denied error.", MIDCOM_LOG_ERROR); |
| 77 | 78 | debug_add('Last MidCOM error string: ' . $e->getMessage()); |
| 78 | 79 | return null; |
@@ -213,7 +213,8 @@ |
||
| 213 | 213 | $browser = new Browser; |
| 214 | 214 | try { |
| 215 | 215 | $response = $browser->send($request); |
| 216 | - } catch (Exception $e) { |
|
| 216 | + } |
|
| 217 | + catch (Exception $e) { |
|
| 217 | 218 | debug_add("Failed to execute request " . $request->getUrl() . ": " . $e->getMessage(), MIDCOM_LOG_WARN); |
| 218 | 219 | return false; |
| 219 | 220 | } |
@@ -680,7 +680,8 @@ |
||
| 680 | 680 | { |
| 681 | 681 | try { |
| 682 | 682 | return midcom_db_person::get_cached($id); |
| 683 | - } catch (midcom_error $e) { |
|
| 683 | + } |
|
| 684 | + catch (midcom_error $e) { |
|
| 684 | 685 | return false; |
| 685 | 686 | } |
| 686 | 687 | } |