@@ -106,7 +106,8 @@ discard block |
||
| 106 | 106 | $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer); |
| 107 | 107 | $entry['customer'] = "<a href=\"{$this->_request_data['invoices_url']}list/customer/all/{$customer->guid}/\">" . $customer->get_label() . "</a>"; |
| 108 | 108 | $entry['index_customer'] = $customer->get_label(); |
| 109 | - } catch (midcom_error $e) { |
|
| 109 | + } |
|
| 110 | + catch (midcom_error $e) { |
|
| 110 | 111 | $entry['customer'] = ''; |
| 111 | 112 | $entry['index_customer'] = ''; |
| 112 | 113 | } |
@@ -117,7 +118,8 @@ discard block |
||
| 117 | 118 | $contact = org_openpsa_contacts_person_dba::get_cached($invoice->customerContact); |
| 118 | 119 | $entry['contact'] = "<a href=\"{$this->_request_data['invoices_url']}list/customer/all/{$contact->guid}/\">" . $contact->get_label() . "</a>"; |
| 119 | 120 | $entry['index_contact'] = $contact->get_label(); |
| 120 | - } catch (midcom_error $e) { |
|
| 121 | + } |
|
| 122 | + catch (midcom_error $e) { |
|
| 121 | 123 | $entry['contact'] = ''; |
| 122 | 124 | $entry['index_contact'] = ''; |
| 123 | 125 | } |
@@ -282,7 +284,8 @@ discard block |
||
| 282 | 284 | { |
| 283 | 285 | try { |
| 284 | 286 | $this->_customer = new org_openpsa_contacts_group_dba($guid); |
| 285 | - } catch (midcom_error $e) { |
|
| 287 | + } |
|
| 288 | + catch (midcom_error $e) { |
|
| 286 | 289 | $this->_customer = new org_openpsa_contacts_person_dba($guid); |
| 287 | 290 | } |
| 288 | 291 | $data['customer'] = $this->_customer; |
@@ -89,7 +89,8 @@ |
||
| 89 | 89 | } elseif ((int) $group > 0) { |
| 90 | 90 | try { |
| 91 | 91 | $this->parent = new org_openpsa_products_product_group_dba((int) $group); |
| 92 | - } catch (midcom_error $e) { |
|
| 92 | + } |
|
| 93 | + catch (midcom_error $e) { |
|
| 93 | 94 | $e->log(); |
| 94 | 95 | } |
| 95 | 96 | } |
@@ -29,7 +29,8 @@ |
||
| 29 | 29 | $member->require_do('midgard:update'); |
| 30 | 30 | $member->extra = $request->request->get('title'); |
| 31 | 31 | $response->status = $member->update(); |
| 32 | - } catch (midcom_error $e) { |
|
| 32 | + } |
|
| 33 | + catch (midcom_error $e) { |
|
| 33 | 34 | $e->log(); |
| 34 | 35 | } |
| 35 | 36 | $response->message = midcom_connection::get_error_string(); |
@@ -348,7 +348,8 @@ |
||
| 348 | 348 | $result = $this->router->match($url); |
| 349 | 349 | $this->_prepare_handler($result); |
| 350 | 350 | return $this->_handler; |
| 351 | - } catch (ResourceNotFoundException $e) { |
|
| 351 | + } |
|
| 352 | + catch (ResourceNotFoundException $e) { |
|
| 352 | 353 | // No match |
| 353 | 354 | return false; |
| 354 | 355 | } |
@@ -46,7 +46,8 @@ |
||
| 46 | 46 | $target = new midcom_db_topic((int) $request->request->get('move_to')); |
| 47 | 47 | $this->_move_object($target); |
| 48 | 48 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), sprintf($this->_l10n->get('moved %s to %s'), $this->_topic->get_label(), $target->get_label())); |
| 49 | - } catch (midcom_error $e) { |
|
| 49 | + } |
|
| 50 | + catch (midcom_error $e) { |
|
| 50 | 51 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), $e->getMessage(), 'error'); |
| 51 | 52 | } |
| 52 | 53 | } |
@@ -100,7 +100,8 @@ |
||
| 100 | 100 | try { |
| 101 | 101 | $task = org_openpsa_projects_task_dba::get_cached($hour_report->task); |
| 102 | 102 | $options['success_url'] = $this->router->generate('list_hours_task', ['guid' => $task->guid]); |
| 103 | - } catch (midcom_error $e) { |
|
| 103 | + } |
|
| 104 | + catch (midcom_error $e) { |
|
| 104 | 105 | $e->log(); |
| 105 | 106 | } |
| 106 | 107 | return $this->get_workflow('delete', $options)->run($request); |
@@ -196,7 +196,8 @@ discard block |
||
| 196 | 196 | foreach ($guids as $guid) { |
| 197 | 197 | try { |
| 198 | 198 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 199 | - } catch (midcom_error $e) { |
|
| 199 | + } |
|
| 200 | + catch (midcom_error $e) { |
|
| 200 | 201 | continue; |
| 201 | 202 | } |
| 202 | 203 | |
@@ -211,7 +212,8 @@ discard block |
||
| 211 | 212 | foreach ($guids as $guid) { |
| 212 | 213 | try { |
| 213 | 214 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 214 | - } catch (midcom_error $e) { |
|
| 215 | + } |
|
| 216 | + catch (midcom_error $e) { |
|
| 215 | 217 | continue; |
| 216 | 218 | } |
| 217 | 219 | |
@@ -40,7 +40,8 @@ |
||
| 40 | 40 | { |
| 41 | 41 | try { |
| 42 | 42 | $this->db = connection::get_em()->getConnection()->getWrappedConnection(); |
| 43 | - } catch (\Exception $e) { |
|
| 43 | + } |
|
| 44 | + catch (\Exception $e) { |
|
| 44 | 45 | $this->db = $this->create_connection($input, $output); |
| 45 | 46 | } |
| 46 | 47 | |
@@ -134,7 +134,8 @@ discard block |
||
| 134 | 134 | ]; |
| 135 | 135 | try { |
| 136 | 136 | $to_arr['other_obj'] = midcom::get()->dbfactory->get_object_by_guid($mc->get_subkey($guid, $object_prefix . 'Guid')); |
| 137 | - } catch (midcom_error $e) { |
|
| 137 | + } |
|
| 138 | + catch (midcom_error $e) { |
|
| 138 | 139 | continue; |
| 139 | 140 | } |
| 140 | 141 | |
@@ -438,7 +439,8 @@ discard block |
||
| 438 | 439 | if (!($this->_object instanceof org_openpsa_relatedto_dba)) { |
| 439 | 440 | $response->status = "method requires guid of a link object as an argument"; |
| 440 | 441 | } |
| 441 | - } catch (midcom_error $e) { |
|
| 442 | + } |
|
| 443 | + catch (midcom_error $e) { |
|
| 442 | 444 | $response->status = "error: " . $e->getMessage(); |
| 443 | 445 | } |
| 444 | 446 | |
@@ -464,7 +466,8 @@ discard block |
||
| 464 | 466 | $relation = new org_openpsa_relatedto_dba($guid); |
| 465 | 467 | $response->result = $relation->delete(); |
| 466 | 468 | $response->status = 'Last message: ' . midcom_connection::get_error_string(); |
| 467 | - } catch (midcom_error $e) { |
|
| 469 | + } |
|
| 470 | + catch (midcom_error $e) { |
|
| 468 | 471 | $response->result = false; |
| 469 | 472 | $response->status = "Object '{$guid}' could not be loaded, error:" . $e->getMessage(); |
| 470 | 473 | } |