@@ -31,7 +31,8 @@ |
||
31 | 31 | foreach ($feeds as $feed) { |
32 | 32 | try { |
33 | 33 | midcom_db_topic::get_cached($feed->node); |
34 | - } catch (midcom_error $e) { |
|
34 | + } |
|
35 | + catch (midcom_error $e) { |
|
35 | 36 | debug_add("Node #{$feed->node} does not exist, skipping feed #{$feed->id}", MIDCOM_LOG_ERROR); |
36 | 37 | continue; |
37 | 38 | } |
@@ -25,7 +25,8 @@ |
||
25 | 25 | { |
26 | 26 | try { |
27 | 27 | $viewer->register_plugin_namespace('__feeds', array('rss' => array('class' => __CLASS__))); |
28 | - } catch (midcom_error $e) { |
|
28 | + } |
|
29 | + catch (midcom_error $e) { |
|
29 | 30 | $e->log(); |
30 | 31 | } |
31 | 32 | } |
@@ -147,7 +147,8 @@ discard block |
||
147 | 147 | foreach ($activities as $activity) { |
148 | 148 | try { |
149 | 149 | $object = midcom::get()->dbfactory->get_object_by_guid($activity->target); |
150 | - } catch (midcom_error $e) { |
|
150 | + } |
|
151 | + catch (midcom_error $e) { |
|
151 | 152 | if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) { |
152 | 153 | // TODO: Visualize deleted objects somehow |
153 | 154 | } |
@@ -155,7 +156,8 @@ discard block |
||
155 | 156 | } |
156 | 157 | try { |
157 | 158 | $actor = midcom_db_person::get_cached($activity->actor); |
158 | - } catch (midcom_error $e) { |
|
159 | + } |
|
160 | + catch (midcom_error $e) { |
|
159 | 161 | $actor = null; |
160 | 162 | } |
161 | 163 | |
@@ -253,7 +255,8 @@ discard block |
||
253 | 255 | foreach ($guids as $guid) { |
254 | 256 | try { |
255 | 257 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
256 | - } catch (midcom_error $e) { |
|
258 | + } |
|
259 | + catch (midcom_error $e) { |
|
257 | 260 | continue; |
258 | 261 | } |
259 | 262 | |
@@ -270,7 +273,8 @@ discard block |
||
270 | 273 | foreach ($guids as $guid) { |
271 | 274 | try { |
272 | 275 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
273 | - } catch (midcom_error $e) { |
|
276 | + } |
|
277 | + catch (midcom_error $e) { |
|
274 | 278 | continue; |
275 | 279 | } |
276 | 280 |
@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | // Add person to campaign |
35 | 35 | try { |
36 | 36 | $campaign = new org_openpsa_directmarketing_campaign_dba($_POST['add_to_campaign']); |
37 | - } catch (midcom_error $e) { |
|
37 | + } |
|
38 | + catch (midcom_error $e) { |
|
38 | 39 | // FIXME: More informative error message |
39 | 40 | $this->notify('Failed adding person %s to campaign %s', $_POST['add_to_campaign'], 'error'); |
40 | 41 | return; |
@@ -87,7 +88,8 @@ discard block |
||
87 | 88 | try { |
88 | 89 | $campaigns[$membership->campaign] = new org_openpsa_directmarketing_campaign_dba($membership->campaign); |
89 | 90 | $campaign_membership_map[$membership->campaign] = $membership; |
90 | - } catch (midcom_error $e) { |
|
91 | + } |
|
92 | + catch (midcom_error $e) { |
|
91 | 93 | debug_add('Failed to load campaign ' . $membership->campaign . ', reason: ' . $e->getMessage()); |
92 | 94 | } |
93 | 95 | } |
@@ -61,7 +61,8 @@ discard block |
||
61 | 61 | //check if related at_entry exists |
62 | 62 | try { |
63 | 63 | $notification_entry = new midcom_services_at_entry_dba($entry); |
64 | - } catch (midcom_error $e) { |
|
64 | + } |
|
65 | + catch (midcom_error $e) { |
|
65 | 66 | //relatedto links to a non-existing at_entry - so create a new one an link to it |
66 | 67 | $notification_entry = new midcom_services_at_entry_dba(); |
67 | 68 | $notification_entry->create(); |
@@ -83,7 +84,8 @@ discard block |
||
83 | 84 | $notification_entry = new midcom_services_at_entry_dba($mc_entry->get_subkey($key, 'fromGuid')); |
84 | 85 | //check if related at_entry exists & delete it |
85 | 86 | $notification_entry->delete(); |
86 | - } catch (midcom_error $e) { |
|
87 | + } |
|
88 | + catch (midcom_error $e) { |
|
87 | 89 | $e->log(); |
88 | 90 | } |
89 | 91 | } |
@@ -120,14 +120,16 @@ |
||
120 | 120 | if (!empty($this->customer)) { |
121 | 121 | try { |
122 | 122 | return org_openpsa_contacts_group_dba::get_cached($this->customer); |
123 | - } catch (midcom_error $e) { |
|
123 | + } |
|
124 | + catch (midcom_error $e) { |
|
124 | 125 | $e->log(); |
125 | 126 | } |
126 | 127 | } |
127 | 128 | if (!empty($this->customerContact)) { |
128 | 129 | try { |
129 | 130 | return org_openpsa_contacts_person_dba::get_cached($this->customerContact); |
130 | - } catch (midcom_error $e) { |
|
131 | + } |
|
132 | + catch (midcom_error $e) { |
|
131 | 133 | $e->log(); |
132 | 134 | } |
133 | 135 | } |
@@ -104,7 +104,8 @@ discard block |
||
104 | 104 | $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer); |
105 | 105 | $entry['customer'] = "<a href=\"{$this->_request_data['invoices_url']}list/customer/all/{$customer->guid}/\">" . $customer->get_label() . "</a>"; |
106 | 106 | $entry['index_customer'] = $customer->get_label(); |
107 | - } catch (midcom_error $e) { |
|
107 | + } |
|
108 | + catch (midcom_error $e) { |
|
108 | 109 | $entry['customer'] = ''; |
109 | 110 | $entry['index_customer'] = ''; |
110 | 111 | } |
@@ -115,7 +116,8 @@ discard block |
||
115 | 116 | $contact = org_openpsa_contacts_person_dba::get_cached($invoice->customerContact); |
116 | 117 | $entry['contact'] = "<a href=\"{$this->_request_data['invoices_url']}list/customer/all/{$contact->guid}/\">" . $contact->get_label() . "</a>"; |
117 | 118 | $entry['index_contact'] = $contact->get_label(); |
118 | - } catch (midcom_error $e) { |
|
119 | + } |
|
120 | + catch (midcom_error $e) { |
|
119 | 121 | $entry['contact'] = ''; |
120 | 122 | $entry['index_contact'] = ''; |
121 | 123 | } |
@@ -290,7 +292,8 @@ discard block |
||
290 | 292 | { |
291 | 293 | try { |
292 | 294 | $this->_customer = new org_openpsa_contacts_group_dba($args[0]); |
293 | - } catch (midcom_error $e) { |
|
295 | + } |
|
296 | + catch (midcom_error $e) { |
|
294 | 297 | $this->_customer = new org_openpsa_contacts_person_dba($args[0]); |
295 | 298 | } |
296 | 299 | $data['customer'] = $this->_customer; |
@@ -38,13 +38,15 @@ |
||
38 | 38 | try { |
39 | 39 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($item->deliverable); |
40 | 40 | $entry['deliverable'] = $deliverable->title; |
41 | - } catch (midcom_error $e) { |
|
41 | + } |
|
42 | + catch (midcom_error $e) { |
|
42 | 43 | $entry['deliverable'] = ''; |
43 | 44 | } |
44 | 45 | try { |
45 | 46 | $task = org_openpsa_projects_task_dba::get_cached($item->task); |
46 | 47 | $entry['task'] = $task->title; |
47 | - } catch (midcom_error $e) { |
|
48 | + } |
|
49 | + catch (midcom_error $e) { |
|
48 | 50 | $entry['task'] = ''; |
49 | 51 | } |
50 | 52 |
@@ -52,7 +52,8 @@ discard block |
||
52 | 52 | try { |
53 | 53 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($task->agreement); |
54 | 54 | $item->deliverable = $deliverable->id; |
55 | - } catch (midcom_error $e) { |
|
55 | + } |
|
56 | + catch (midcom_error $e) { |
|
56 | 57 | $e->log(); |
57 | 58 | } |
58 | 59 | $item->invoice = $invoice->id; |
@@ -144,7 +145,8 @@ discard block |
||
144 | 145 | $customer = org_openpsa_contacts_group_dba::get_cached($customer_id); |
145 | 146 | $data['customer_label'] = $customer->official; |
146 | 147 | $data['disabled'] = ''; |
147 | - } catch (midcom_error $e) { |
|
148 | + } |
|
149 | + catch (midcom_error $e) { |
|
148 | 150 | $data['customer_label'] = $this->_l10n->get('no customer'); |
149 | 151 | $data['disabled'] = ' disabled="disabled"'; |
150 | 152 | } |
@@ -167,7 +169,8 @@ discard block |
||
167 | 169 | } else { |
168 | 170 | $data['invoiceable_units'] = $task->plannedHours; |
169 | 171 | } |
170 | - } catch (midcom_error $e) { |
|
172 | + } |
|
173 | + catch (midcom_error $e) { |
|
171 | 174 | $e->log(); |
172 | 175 | if ($this->_config->get('default_hourly_price')) { |
173 | 176 | $data['default_price'] = $this->_config->get('default_hourly_price'); |