@@ -423,7 +423,8 @@ |
||
423 | 423 | */ |
424 | 424 | try { |
425 | 425 | return $object->get_by_id($object->id); |
426 | - } catch (Exception) { |
|
426 | + } |
|
427 | + catch (Exception) { |
|
427 | 428 | return false; |
428 | 429 | } |
429 | 430 | } |
@@ -93,7 +93,8 @@ discard block |
||
93 | 93 | try { |
94 | 94 | $this->_backend->index($documents); |
95 | 95 | return true; |
96 | - } catch (Exception $e) { |
|
96 | + } |
|
97 | + catch (Exception $e) { |
|
97 | 98 | if ($batch) { |
98 | 99 | throw $e; |
99 | 100 | } |
@@ -122,7 +123,8 @@ discard block |
||
122 | 123 | try { |
123 | 124 | $this->_backend->delete($RIs); |
124 | 125 | return true; |
125 | - } catch (Exception $e) { |
|
126 | + } |
|
127 | + catch (Exception $e) { |
|
126 | 128 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
127 | 129 | return false; |
128 | 130 | } |
@@ -142,7 +144,8 @@ discard block |
||
142 | 144 | try { |
143 | 145 | $this->_backend->delete_all($constraint); |
144 | 146 | return true; |
145 | - } catch (Exception $e) { |
|
147 | + } |
|
148 | + catch (Exception $e) { |
|
146 | 149 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
147 | 150 | return false; |
148 | 151 | } |
@@ -175,7 +178,8 @@ discard block |
||
175 | 178 | |
176 | 179 | try { |
177 | 180 | $result_raw = $this->_backend->query($query, $filter, $options); |
178 | - } catch (Exception $e) { |
|
181 | + } |
|
182 | + catch (Exception $e) { |
|
179 | 183 | debug_add("Query error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
180 | 184 | return $result; |
181 | 185 | } |
@@ -196,7 +200,8 @@ discard block |
||
196 | 200 | if (!empty($document->topic_guid)) { |
197 | 201 | try { |
198 | 202 | midcom_db_topic::get_cached($document->topic_guid); |
199 | - } catch (midcom_error) { |
|
203 | + } |
|
204 | + catch (midcom_error) { |
|
200 | 205 | // Skip document, the object is hidden. |
201 | 206 | debug_add("Skipping the generic document {$document->title}, its topic seems to be invisible, we cannot proceed."); |
202 | 207 | continue; |
@@ -209,7 +214,8 @@ discard block |
||
209 | 214 | // Strip language code from end of RI if it looks like "<GUID>_<LANG>" |
210 | 215 | try { |
211 | 216 | midcom::get()->dbfactory->get_object_by_guid(preg_replace('/^([0-9a-f]{32,80})_[a-z]{2}$/', '\\1', $document->RI)); |
212 | - } catch (midcom_error) { |
|
217 | + } |
|
218 | + catch (midcom_error) { |
|
213 | 219 | // Skip document, the object is hidden, deleted or otherwise unavailable. |
214 | 220 | //@todo Maybe nonexistent objects should be removed from index? |
215 | 221 | continue; |
@@ -510,7 +510,8 @@ |
||
510 | 510 | { |
511 | 511 | try { |
512 | 512 | return midcom_db_person::get_cached($guid); |
513 | - } catch (midcom_error) { |
|
513 | + } |
|
514 | + catch (midcom_error) { |
|
514 | 515 | return null; |
515 | 516 | } |
516 | 517 | } |
@@ -77,7 +77,8 @@ |
||
77 | 77 | if (!array_key_exists($id, $this->_user_cache)) { |
78 | 78 | try { |
79 | 79 | $this->_user_cache[$id] = new midcom_core_user($param); |
80 | - } catch (midcom_error) { |
|
80 | + } |
|
81 | + catch (midcom_error) { |
|
81 | 82 | // Keep it silent while missing user object can mess here |
82 | 83 | $this->_user_cache[$id] = null; |
83 | 84 | } |
@@ -84,7 +84,8 @@ |
||
84 | 84 | |
85 | 85 | try { |
86 | 86 | $user = new midgard_user($login_tokens); |
87 | - } catch (mgd_exception) { |
|
87 | + } |
|
88 | + catch (mgd_exception) { |
|
88 | 89 | return null; |
89 | 90 | } |
90 | 91 | if (!$trusted && !self::verify_password($password, $user->password)) { |
@@ -112,7 +112,8 @@ |
||
112 | 112 | if ($this->__cached_object === null) { |
113 | 113 | try { |
114 | 114 | $this->__cached_object = midcom::get()->dbfactory->get_object_by_guid($this->objectguid); |
115 | - } catch (midcom_error) { |
|
115 | + } |
|
116 | + catch (midcom_error) { |
|
116 | 117 | return null; |
117 | 118 | } |
118 | 119 | } |
@@ -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 { |