@@ -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 | } |
@@ -46,7 +46,8 @@ discard block |
||
46 | 46 | $object = self::_load_backend($backend, $params); |
47 | 47 | debug_add('Using backend ' . $backend); |
48 | 48 | return $object; |
49 | - } catch (midcom_error $e) { |
|
49 | + } |
|
50 | + catch (midcom_error $e) { |
|
50 | 51 | debug_add('Failed to load backend ' . $backend . ', message:' . $e->getMessage()); |
51 | 52 | } |
52 | 53 | } |
@@ -76,7 +77,8 @@ discard block |
||
76 | 77 | $this->mail($message); |
77 | 78 | $this->error = null; |
78 | 79 | return true; |
79 | - } catch (Exception $e) { |
|
80 | + } |
|
81 | + catch (Exception $e) { |
|
80 | 82 | $this->error = $e->getMessage(); |
81 | 83 | return false; |
82 | 84 | } |
@@ -50,7 +50,8 @@ |
||
50 | 50 | try { |
51 | 51 | \midgard_object_class::get_object_by_guid($priv->objectguid); |
52 | 52 | $seen_parents[$priv->objectguid] = true; |
53 | - } catch (\Exception $e) { |
|
53 | + } |
|
54 | + catch (\Exception $e) { |
|
54 | 55 | $seen_parents[$priv->objectguid] = false; |
55 | 56 | } |
56 | 57 | } |