@@ -131,7 +131,8 @@ discard block |
||
| 131 | 131 | try { |
| 132 | 132 | $this->_backend->index($documents); |
| 133 | 133 | return true; |
| 134 | - } catch (Exception $e) { |
|
| 134 | + } |
|
| 135 | + catch (Exception $e) { |
|
| 135 | 136 | if ($batch) { |
| 136 | 137 | throw $e; |
| 137 | 138 | } |
@@ -160,7 +161,8 @@ discard block |
||
| 160 | 161 | try { |
| 161 | 162 | $this->_backend->delete($RIs); |
| 162 | 163 | return true; |
| 163 | - } catch (Exception $e) { |
|
| 164 | + } |
|
| 165 | + catch (Exception $e) { |
|
| 164 | 166 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 165 | 167 | return false; |
| 166 | 168 | } |
@@ -182,7 +184,8 @@ discard block |
||
| 182 | 184 | try { |
| 183 | 185 | $this->_backend->delete_all($constraint); |
| 184 | 186 | return true; |
| 185 | - } catch (Exception $e) { |
|
| 187 | + } |
|
| 188 | + catch (Exception $e) { |
|
| 186 | 189 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 187 | 190 | return false; |
| 188 | 191 | } |
@@ -216,7 +219,8 @@ discard block |
||
| 216 | 219 | |
| 217 | 220 | try { |
| 218 | 221 | $result_raw = $this->_backend->query($query, $filter, $options); |
| 219 | - } catch (Exception $e) { |
|
| 222 | + } |
|
| 223 | + catch (Exception $e) { |
|
| 220 | 224 | debug_add("Query error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 221 | 225 | return $result; |
| 222 | 226 | } |
@@ -237,7 +241,8 @@ discard block |
||
| 237 | 241 | if (!empty($document->topic_guid)) { |
| 238 | 242 | try { |
| 239 | 243 | midcom_db_topic::get_cached($document->topic_guid); |
| 240 | - } catch (midcom_error $e) { |
|
| 244 | + } |
|
| 245 | + catch (midcom_error $e) { |
|
| 241 | 246 | // Skip document, the object is hidden. |
| 242 | 247 | debug_add("Skipping the generic document {$document->title}, its topic seems to be invisible, we cannot proceed."); |
| 243 | 248 | continue; |
@@ -250,7 +255,8 @@ discard block |
||
| 250 | 255 | // Strip language code from end of RI if it looks like "<GUID>_<LANG>" |
| 251 | 256 | try { |
| 252 | 257 | midcom::get()->dbfactory->get_object_by_guid(preg_replace('/^([0-9a-f]{32,80})_[a-z]{2}$/', '\\1', $document->RI)); |
| 253 | - } catch (midcom_error $e) { |
|
| 258 | + } |
|
| 259 | + catch (midcom_error $e) { |
|
| 254 | 260 | // Skip document, the object is hidden, deleted or otherwise unavailable. |
| 255 | 261 | //@todo Maybe nonexistent objects should be removed from index? |
| 256 | 262 | continue; |
@@ -409,7 +409,8 @@ |
||
| 409 | 409 | //Get the parent object |
| 410 | 410 | try { |
| 411 | 411 | $parent = midcom::get()->dbfactory->get_object_by_guid($this->objectguid); |
| 412 | - } catch (midcom_error $e) { |
|
| 412 | + } |
|
| 413 | + catch (midcom_error $e) { |
|
| 413 | 414 | $e->log(); |
| 414 | 415 | return; |
| 415 | 416 | } |
@@ -95,7 +95,8 @@ |
||
| 95 | 95 | org_openpsa_projects_workflow::accept($task, 0, $this->comment); |
| 96 | 96 | return; |
| 97 | 97 | } |
| 98 | - } catch (midcom_error $e) { |
|
| 98 | + } |
|
| 99 | + catch (midcom_error $e) { |
|
| 99 | 100 | $e->log(); |
| 100 | 101 | } |
| 101 | 102 | } |
@@ -197,7 +197,8 @@ |
||
| 197 | 197 | if ($this->_response === null) { |
| 198 | 198 | $this->_stop('Could not handle request, unknown method', 405); |
| 199 | 199 | } |
| 200 | - } catch (midcom_error $e) { |
|
| 200 | + } |
|
| 201 | + catch (midcom_error $e) { |
|
| 201 | 202 | $this->_responseStatus = $e->getCode(); |
| 202 | 203 | return $this->_send_response($e->getMessage()); |
| 203 | 204 | } |
@@ -165,7 +165,8 @@ |
||
| 165 | 165 | try { |
| 166 | 166 | self::$root_topic = midcom_db_topic::get_cached($guid); |
| 167 | 167 | return self::$root_topic; |
| 168 | - } catch (midcom_error $e) { |
|
| 168 | + } |
|
| 169 | + catch (midcom_error $e) { |
|
| 169 | 170 | if ($e instanceof midcom_error_forbidden) { |
| 170 | 171 | throw $e; |
| 171 | 172 | } |
@@ -673,7 +673,8 @@ |
||
| 673 | 673 | */ |
| 674 | 674 | try { |
| 675 | 675 | return $object->get_by_id($object->id); |
| 676 | - } catch (Exception $e) { |
|
| 676 | + } |
|
| 677 | + catch (Exception $e) { |
|
| 677 | 678 | return false; |
| 678 | 679 | } |
| 679 | 680 | } |
@@ -80,7 +80,8 @@ |
||
| 80 | 80 | |
| 81 | 81 | try { |
| 82 | 82 | require $basedir . $file; |
| 83 | - } catch (\midcom_error_forbidden $e) { |
|
| 83 | + } |
|
| 84 | + catch (\midcom_error_forbidden $e) { |
|
| 84 | 85 | $dialog = $this->getHelperSet()->get('question'); |
| 85 | 86 | $this->login($dialog, $input, $output); |
| 86 | 87 | require $basedir . $file; |
@@ -72,7 +72,8 @@ |
||
| 72 | 72 | $component = key($watch); |
| 73 | 73 | try { |
| 74 | 74 | $interface = $this->loader->get_interface_class($component); |
| 75 | - } catch (\midcom_error $e) { |
|
| 75 | + } |
|
| 76 | + catch (\midcom_error $e) { |
|
| 76 | 77 | debug_add("Failed to load the component {$component}: " . $e->getMessage(), MIDCOM_LOG_INFO); |
| 77 | 78 | continue; |
| 78 | 79 | } |
@@ -99,7 +99,8 @@ |
||
| 99 | 99 | if ($request->request->has('midcom_helper_datamanager2_save')) { |
| 100 | 100 | try { |
| 101 | 101 | $rules = $this->_load_rules($request); |
| 102 | - } catch (midcom_error $e) { |
|
| 102 | + } |
|
| 103 | + catch (midcom_error $e) { |
|
| 103 | 104 | midcom::get()->uimessages->add('org.openpsa.directmarketing', $this->_l10n->get($e->getMessage()), 'error'); |
| 104 | 105 | return; |
| 105 | 106 | } |