@@ -239,7 +239,8 @@ discard block |
||
| 239 | 239 | // Not a MidCOM DBA object |
| 240 | 240 | try { |
| 241 | 241 | $obj = midcom::get()->dbfactory->convert_midgard_to_midcom($object); |
| 242 | - } catch (midcom_error $e) { |
|
| 242 | + } |
|
| 243 | + catch (midcom_error $e) { |
|
| 243 | 244 | return false; |
| 244 | 245 | } |
| 245 | 246 | } else { |
@@ -702,7 +703,8 @@ discard block |
||
| 702 | 703 | if (!isset(self::$_cache['name'][$key])) { |
| 703 | 704 | try { |
| 704 | 705 | self::$_cache['name'][$key] = self::get($object)->get_name_property_nonstatic($object); |
| 705 | - } catch (midcom_error $e) { |
|
| 706 | + } |
|
| 707 | + catch (midcom_error $e) { |
|
| 706 | 708 | debug_add('Could not get reflector instance for class ' . $key . ': ' . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 707 | 709 | self::$_cache['name'][$key] = null; |
| 708 | 710 | } |
@@ -25,7 +25,8 @@ |
||
| 25 | 25 | { |
| 26 | 26 | try { |
| 27 | 27 | $viewer->register_plugin_namespace('__feeds', ['rss' => ['class' => __CLASS__]]); |
| 28 | - } catch (midcom_error $e) { |
|
| 28 | + } |
|
| 29 | + catch (midcom_error $e) { |
|
| 29 | 30 | $e->log(); |
| 30 | 31 | } |
| 31 | 32 | } |
@@ -62,7 +62,8 @@ |
||
| 62 | 62 | try { |
| 63 | 63 | $this->__object = call_user_func([$this->__midcom_class_name__, 'get_cached'], $this->__identifier); |
| 64 | 64 | return true; |
| 65 | - } catch (midcom_error $e) { |
|
| 65 | + } |
|
| 66 | + catch (midcom_error $e) { |
|
| 66 | 67 | $e->log(); |
| 67 | 68 | } |
| 68 | 69 | return false; |
@@ -553,7 +553,8 @@ |
||
| 553 | 553 | $tree = []; |
| 554 | 554 | try { |
| 555 | 555 | $children = self::get_child_objects($parent); |
| 556 | - } catch (midcom_error $e) { |
|
| 556 | + } |
|
| 557 | + catch (midcom_error $e) { |
|
| 557 | 558 | return $tree; |
| 558 | 559 | } |
| 559 | 560 | |
@@ -85,7 +85,8 @@ |
||
| 85 | 85 | $productgroup = new org_openpsa_products_product_group_dba($this->_product->productGroup); |
| 86 | 86 | $title = str_replace('<PRODUCTGROUP_TITLE>', $productgroup->title, $title); |
| 87 | 87 | $title = str_replace('<PRODUCTGROUP_CODE>', $productgroup->code, $title); |
| 88 | - } catch (midcom_error $e) { |
|
| 88 | + } |
|
| 89 | + catch (midcom_error $e) { |
|
| 89 | 90 | $title = str_replace(['<PRODUCTGROUP_TITLE>', '<PRODUCTGROUP_CODE>'], '', $title); |
| 90 | 91 | } |
| 91 | 92 | } |
@@ -148,7 +148,8 @@ discard block |
||
| 148 | 148 | ]; |
| 149 | 149 | try { |
| 150 | 150 | $to_arr['other_obj'] = midcom::get()->dbfactory->get_object_by_guid($mc->get_subkey($guid, $object_prefix . 'Guid')); |
| 151 | - } catch (midcom_error $e) { |
|
| 151 | + } |
|
| 152 | + catch (midcom_error $e) { |
|
| 152 | 153 | continue; |
| 153 | 154 | } |
| 154 | 155 | |
@@ -455,7 +456,8 @@ discard block |
||
| 455 | 456 | if (!($this->_object instanceof org_openpsa_relatedto_dba)) { |
| 456 | 457 | $response->status = "method '{$this->_mode}' requires guid of a link object as an argument"; |
| 457 | 458 | } |
| 458 | - } catch (midcom_error $e) { |
|
| 459 | + } |
|
| 460 | + catch (midcom_error $e) { |
|
| 459 | 461 | $response->status = "method '{$this->_mode}' requires guid of a link object as an argument"; |
| 460 | 462 | } |
| 461 | 463 | } |
@@ -492,7 +494,8 @@ discard block |
||
| 492 | 494 | $relation = new org_openpsa_relatedto_dba($args[0]); |
| 493 | 495 | $response->result = $relation->delete(); |
| 494 | 496 | $response->status = 'Last message: ' . midcom_connection::get_error_string(); |
| 495 | - } catch (midcom_error $e) { |
|
| 497 | + } |
|
| 498 | + catch (midcom_error $e) { |
|
| 496 | 499 | $response->result = false; |
| 497 | 500 | $response->status = "Object '{$args[0]}' could not be loaded, error:" . $e->getMessage(); |
| 498 | 501 | } |
@@ -123,7 +123,8 @@ |
||
| 123 | 123 | $row = []; |
| 124 | 124 | try { |
| 125 | 125 | $row['person'] = org_openpsa_contacts_person_dba::get_cached($hour->person); |
| 126 | - } catch (midcom_error $e) { |
|
| 126 | + } |
|
| 127 | + catch (midcom_error $e) { |
|
| 127 | 128 | $e->log(); |
| 128 | 129 | continue; |
| 129 | 130 | } |
@@ -222,7 +222,8 @@ discard block |
||
| 222 | 222 | $this->_backend->send($person, $member, $token, $subject, $content, $from); |
| 223 | 223 | self::$_messages_sent++; |
| 224 | 224 | $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT; |
| 225 | - } catch (midcom_error $e) { |
|
| 225 | + } |
|
| 226 | + catch (midcom_error $e) { |
|
| 226 | 227 | $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::FAILURE; |
| 227 | 228 | if (!$this->test_mode) { |
| 228 | 229 | $params[] = [ |
@@ -279,7 +280,8 @@ discard block |
||
| 279 | 280 | { |
| 280 | 281 | try { |
| 281 | 282 | $person = org_openpsa_contacts_person_dba::get_cached($member->person); |
| 282 | - } catch (midcom_error $e) { |
|
| 283 | + } |
|
| 284 | + catch (midcom_error $e) { |
|
| 283 | 285 | debug_add("Person #{$member->person} deleted or missing, removing member (member #{$member->id})"); |
| 284 | 286 | $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED; |
| 285 | 287 | $member->delete(); |
@@ -69,7 +69,8 @@ |
||
| 69 | 69 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |
| 70 | 70 | |
| 71 | 71 | $defaults['customer'] = $customer->id; |
| 72 | - } catch (midcom_error $e) { |
|
| 72 | + } |
|
| 73 | + catch (midcom_error $e) { |
|
| 73 | 74 | $customer = new org_openpsa_contacts_person_dba($args[0]); |
| 74 | 75 | $defaults['customerContact'] = $customer->id; |
| 75 | 76 | $field['type_config']['options'] = org_openpsa_helpers_list::task_groups(new org_openpsa_sales_salesproject_dba, 'id', [$customer->id => true]); |