@@ -119,7 +119,8 @@ discard block |
||
119 | 119 | try { |
120 | 120 | $creator = new midcom_db_person($view_metadata->get('creator')); |
121 | 121 | $creator_string = "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$creator->guid}/\">$creator->name</a>"; |
122 | - } catch (midcom_error $e) { |
|
122 | + } |
|
123 | + catch (midcom_error $e) { |
|
123 | 124 | $creator_string = $l10n->get('unknown person'); |
124 | 125 | } |
125 | 126 | $formatter = $data['l10n']->get_formatter(); |
@@ -133,7 +134,8 @@ discard block |
||
133 | 134 | try { |
134 | 135 | $editor = new midcom_db_person($view_metadata->get('revisor')); |
135 | 136 | $editor_string = "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$editor->guid}/\">$editor->name</a>"; |
136 | - } catch (midcom_error $e) { |
|
137 | + } |
|
138 | + catch (midcom_error $e) { |
|
137 | 139 | $editor_string = $l10n->get('unknown person'); |
138 | 140 | } |
139 | 141 |
@@ -73,7 +73,8 @@ |
||
73 | 73 | if ($stat instanceof midcom_services_indexer_client) { |
74 | 74 | try { |
75 | 75 | $stat->reindex(); |
76 | - } catch (RequestException $e) { |
|
76 | + } |
|
77 | + catch (RequestException $e) { |
|
77 | 78 | if ($e->hasResponse()) { |
78 | 79 | $crawler = new Crawler($e->getResponse()->getBody()->getContents()); |
79 | 80 | $body = $crawler->filterXPath('//body')->html(); |
@@ -123,7 +123,8 @@ |
||
123 | 123 | try { |
124 | 124 | $this->$function($request->request, $request->files); |
125 | 125 | $this->response['success'] = true; |
126 | - } catch (midcom_error $e) { |
|
126 | + } |
|
127 | + catch (midcom_error $e) { |
|
127 | 128 | $this->response['success'] = false; |
128 | 129 | $this->response['error'] = $e->getMessage(); |
129 | 130 | } |
@@ -33,7 +33,8 @@ |
||
33 | 33 | $member->require_do('midgard:update'); |
34 | 34 | $member->extra = $request->request->get('title'); |
35 | 35 | $response['status'] = $member->update(); |
36 | - } catch (midcom_error $e) { |
|
36 | + } |
|
37 | + catch (midcom_error $e) { |
|
37 | 38 | $e->log(); |
38 | 39 | } |
39 | 40 | $response['message'] = midcom_connection::get_error_string(); |
@@ -116,7 +116,8 @@ discard block |
||
116 | 116 | //TODO: check for duplicates ? |
117 | 117 | try { |
118 | 118 | $result = ['other_obj' => midcom::get()->dbfactory->get_object_by_guid($link[$other . 'Guid'])]; |
119 | - } catch (midcom_error $e) { |
|
119 | + } |
|
120 | + catch (midcom_error $e) { |
|
120 | 121 | continue; |
121 | 122 | } |
122 | 123 | $result['link'] = [ |
@@ -403,7 +404,8 @@ discard block |
||
403 | 404 | if (!($this->_object instanceof org_openpsa_relatedto_dba)) { |
404 | 405 | $response['status'] = "method requires guid of a link object as an argument"; |
405 | 406 | } |
406 | - } catch (midcom_error $e) { |
|
407 | + } |
|
408 | + catch (midcom_error $e) { |
|
407 | 409 | $response['status'] = "error: " . $e->getMessage(); |
408 | 410 | } |
409 | 411 | |
@@ -424,7 +426,8 @@ discard block |
||
424 | 426 | $relation = new org_openpsa_relatedto_dba($guid); |
425 | 427 | $result = $relation->delete(); |
426 | 428 | $status = 'Last message: ' . midcom_connection::get_error_string(); |
427 | - } catch (midcom_error $e) { |
|
429 | + } |
|
430 | + catch (midcom_error $e) { |
|
428 | 431 | $result = false; |
429 | 432 | $status = "Object '{$guid}' could not be loaded, error:" . $e->getMessage(); |
430 | 433 | } |
@@ -79,7 +79,8 @@ |
||
79 | 79 | if (!array_key_exists($id, $this->_user_cache)) { |
80 | 80 | try { |
81 | 81 | $this->_user_cache[$id] = new midcom_core_user($param); |
82 | - } catch (midcom_error $e) { |
|
82 | + } |
|
83 | + catch (midcom_error $e) { |
|
83 | 84 | // Keep it silent while missing user object can mess here |
84 | 85 | $this->_user_cache[$id] = null; |
85 | 86 | } |
@@ -56,7 +56,8 @@ |
||
56 | 56 | try { |
57 | 57 | $backend->update(midcom::get()->auth->user->id ?? 'NOBODY', $message); |
58 | 58 | return true; |
59 | - } catch (midcom_error $e) { |
|
59 | + } |
|
60 | + catch (midcom_error $e) { |
|
60 | 61 | debug_add('RCS: Could not save file!'); |
61 | 62 | $e->log(); |
62 | 63 | return false; |
@@ -155,7 +155,8 @@ discard block |
||
155 | 155 | { |
156 | 156 | try { |
157 | 157 | Locales::getName($lang); |
158 | - } catch (Exception $e) { |
|
158 | + } |
|
159 | + catch (Exception $e) { |
|
159 | 160 | debug_add("Language {$lang} not found:" . $e->getMessage(), MIDCOM_LOG_ERROR); |
160 | 161 | return false; |
161 | 162 | } |
@@ -236,7 +237,8 @@ discard block |
||
236 | 237 | { |
237 | 238 | try { |
238 | 239 | return $this->get_l10n($component)->get($stringid); |
239 | - } catch (midcom_error $e) { |
|
240 | + } |
|
241 | + catch (midcom_error $e) { |
|
240 | 242 | $e->log(MIDCOM_LOG_WARN); |
241 | 243 | return $stringid; |
242 | 244 | } |
@@ -98,7 +98,8 @@ |
||
98 | 98 | $node_guid = $siteconfig->get_node_guid($component); |
99 | 99 | try { |
100 | 100 | $available_generators[$component] = midcom_db_topic::get_cached($node_guid)->get_label(); |
101 | - } catch (midcom_error $e) { |
|
101 | + } |
|
102 | + catch (midcom_error $e) { |
|
102 | 103 | debug_add("topic for component '{$component}' not found or accessible"); |
103 | 104 | } |
104 | 105 | } |