@@ -50,7 +50,8 @@ discard block |
||
50 | 50 | { |
51 | 51 | try { |
52 | 52 | $tmp = midgard_object_class::get_object_by_guid($guid); |
53 | - } catch (mgd_exception $e) { |
|
53 | + } |
|
54 | + catch (mgd_exception $e) { |
|
54 | 55 | debug_add('Loading object by GUID ' . $guid . ' failed, reason: ' . $e->getMessage(), MIDCOM_LOG_INFO); |
55 | 56 | |
56 | 57 | throw new midcom_error_midgard($e, $guid); |
@@ -159,7 +160,8 @@ discard block |
||
159 | 160 | |
160 | 161 | try { |
161 | 162 | return $this->get_cached($classname, $parent_guid); |
162 | - } catch (midcom_error) { |
|
163 | + } |
|
164 | + catch (midcom_error) { |
|
163 | 165 | return null; |
164 | 166 | } |
165 | 167 | } |
@@ -49,7 +49,8 @@ |
||
49 | 49 | } elseif (!empty($this->data[MIDCOM_NAV_GUID])) { |
50 | 50 | try { |
51 | 51 | $this->data[MIDCOM_NAV_OBJECT] = midcom::get()->dbfactory->get_object_by_guid($this->data[MIDCOM_NAV_GUID]); |
52 | - } catch (midcom_error) { |
|
52 | + } |
|
53 | + catch (midcom_error) { |
|
53 | 54 | } |
54 | 55 | } else { |
55 | 56 | debug_add("Warning: The leaf {$this->leafid} of topic {$topic->id} does set neither a GUID nor an object."); |
@@ -153,7 +153,8 @@ |
||
153 | 153 | if ($object instanceof mgdobject) { |
154 | 154 | try { |
155 | 155 | $obj = midcom::get()->dbfactory->convert_midgard_to_midcom($object); |
156 | - } catch (midcom_error) { |
|
156 | + } |
|
157 | + catch (midcom_error) { |
|
157 | 158 | return null; |
158 | 159 | } |
159 | 160 | } else { |
@@ -59,7 +59,8 @@ |
||
59 | 59 | try { |
60 | 60 | \midgard_object_class::get_object_by_guid($priv->objectguid); |
61 | 61 | $seen_parents[$priv->objectguid] = true; |
62 | - } catch (\Exception) { |
|
62 | + } |
|
63 | + catch (\Exception) { |
|
63 | 64 | $seen_parents[$priv->objectguid] = false; |
64 | 65 | } |
65 | 66 | } |
@@ -49,7 +49,8 @@ |
||
49 | 49 | try { |
50 | 50 | \midgard_object_class::get_object_by_guid($param->parentguid); |
51 | 51 | $seen[$param->parentguid] = true; |
52 | - } catch (\Exception) { |
|
52 | + } |
|
53 | + catch (\Exception) { |
|
53 | 54 | $seen[$param->parentguid] = false; |
54 | 55 | } |
55 | 56 | } |
@@ -37,7 +37,8 @@ |
||
37 | 37 | { |
38 | 38 | try { |
39 | 39 | $this->db = connection::get_em()->getConnection()->getNativeConnection(); |
40 | - } catch (\Exception) { |
|
40 | + } |
|
41 | + catch (\Exception) { |
|
41 | 42 | $this->db = $this->create_connection($input, $output); |
42 | 43 | } |
43 | 44 |
@@ -94,7 +94,8 @@ |
||
94 | 94 | |
95 | 95 | try { |
96 | 96 | require $basedir . $file; |
97 | - } catch (\midcom_error_forbidden) { |
|
97 | + } |
|
98 | + catch (\midcom_error_forbidden) { |
|
98 | 99 | $dialog = $this->getHelperSet()->get('question'); |
99 | 100 | $this->login($dialog, $input, $output); |
100 | 101 | require $basedir . $file; |
@@ -59,7 +59,8 @@ discard block |
||
59 | 59 | |
60 | 60 | try { |
61 | 61 | $result = $router->match($url); |
62 | - } catch (ResourceNotFoundException) { |
|
62 | + } |
|
63 | + catch (ResourceNotFoundException) { |
|
63 | 64 | throw new midcom_error_notfound('This URL method is unknown.'); |
64 | 65 | } |
65 | 66 | $this->request->attributes->add($result); |
@@ -118,11 +119,13 @@ discard block |
||
118 | 119 | |
119 | 120 | try { |
120 | 121 | $result = $router->match($url); |
121 | - } catch (ResourceNotFoundException) { |
|
122 | + } |
|
123 | + catch (ResourceNotFoundException) { |
|
122 | 124 | // No match |
123 | 125 | debug_add("Component {$viewer->_component} in {$viewer->_topic->name} declared unable to handle request.", MIDCOM_LOG_INFO); |
124 | 126 | throw new midcom_error_notfound("This page is not available on this server."); |
125 | - } catch (MethodNotAllowedException $e) { |
|
127 | + } |
|
128 | + catch (MethodNotAllowedException $e) { |
|
126 | 129 | debug_add("Component {$viewer->_component} in {$viewer->_topic->name} declared unable to handle request (method not allowed).", MIDCOM_LOG_INFO); |
127 | 130 | throw new midcom_error_forbidden($e->getMessage(), Response::HTTP_METHOD_NOT_ALLOWED); |
128 | 131 | } |
@@ -74,7 +74,8 @@ |
||
74 | 74 | } |
75 | 75 | try { |
76 | 76 | $this->_storage = new midgard_group($id); |
77 | - } catch (mgd_exception $e) { |
|
77 | + } |
|
78 | + catch (mgd_exception $e) { |
|
78 | 79 | debug_add('Tried to load a midgard_group, but got error ' . $e->getMessage(), MIDCOM_LOG_ERROR); |
79 | 80 | throw new midcom_error_midgard($e->getMessage(), $id); |
80 | 81 | } |