@@ -94,7 +94,8 @@ |
||
| 94 | 94 | |
| 95 | 95 | try { |
| 96 | 96 | require $basedir . $file; |
| 97 | - } catch (\midcom_error_forbidden) { |
|
| 97 | + } |
|
| 98 | + catch (\midcom_error_forbidden) { |
|
| 98 | 99 | $dialog = $this->getHelperSet()->get('question'); |
| 99 | 100 | $this->login($dialog, $input, $output); |
| 100 | 101 | require $basedir . $file; |
@@ -59,7 +59,8 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | try { |
| 61 | 61 | $result = $router->match($url); |
| 62 | - } catch (ResourceNotFoundException) { |
|
| 62 | + } |
|
| 63 | + catch (ResourceNotFoundException) { |
|
| 63 | 64 | throw new midcom_error_notfound('This URL method is unknown.'); |
| 64 | 65 | } |
| 65 | 66 | $this->request->attributes->add($result); |
@@ -118,11 +119,13 @@ discard block |
||
| 118 | 119 | |
| 119 | 120 | try { |
| 120 | 121 | $result = $router->match($url); |
| 121 | - } catch (ResourceNotFoundException) { |
|
| 122 | + } |
|
| 123 | + catch (ResourceNotFoundException) { |
|
| 122 | 124 | // No match |
| 123 | 125 | debug_add("Component {$viewer->_component} in {$viewer->_topic->name} declared unable to handle request.", MIDCOM_LOG_INFO); |
| 124 | 126 | throw new midcom_error_notfound("This page is not available on this server."); |
| 125 | - } catch (MethodNotAllowedException $e) { |
|
| 127 | + } |
|
| 128 | + catch (MethodNotAllowedException $e) { |
|
| 126 | 129 | debug_add("Component {$viewer->_component} in {$viewer->_topic->name} declared unable to handle request (method not allowed).", MIDCOM_LOG_INFO); |
| 127 | 130 | throw new midcom_error_forbidden($e->getMessage(), Response::HTTP_METHOD_NOT_ALLOWED); |
| 128 | 131 | } |
@@ -74,7 +74,8 @@ |
||
| 74 | 74 | } |
| 75 | 75 | try { |
| 76 | 76 | $this->_storage = new midgard_group($id); |
| 77 | - } catch (mgd_exception $e) { |
|
| 77 | + } |
|
| 78 | + catch (mgd_exception $e) { |
|
| 78 | 79 | debug_add('Tried to load a midgard_group, but got error ' . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 79 | 80 | throw new midcom_error_midgard($e, $id); |
| 80 | 81 | } |
@@ -112,7 +112,8 @@ |
||
| 112 | 112 | foreach ($qb->execute() as $article) { |
| 113 | 113 | try { |
| 114 | 114 | $datamanager->set_storage($article); |
| 115 | - } catch (midcom_error $e) { |
|
| 115 | + } |
|
| 116 | + catch (midcom_error $e) { |
|
| 116 | 117 | $e->log(); |
| 117 | 118 | continue; |
| 118 | 119 | } |
@@ -46,7 +46,8 @@ |
||
| 46 | 46 | $customer_html = '<a href="' . $contacts_url . '/group/' . $customer->guid . '/">' . $customer_html . "</a>\n"; |
| 47 | 47 | } |
| 48 | 48 | echo $customer_html; |
| 49 | - } catch (midcom_error) { |
|
| 49 | + } |
|
| 50 | + catch (midcom_error) { |
|
| 50 | 51 | } |
| 51 | 52 | |
| 52 | 53 | if ($project->manager) { |
@@ -162,9 +162,9 @@ |
||
| 162 | 162 | $result = []; |
| 163 | 163 | |
| 164 | 164 | $accounthelper = $this->get_accounthelper(new midcom_db_person($fields["person"])); |
| 165 | - if (!$accounthelper->check_password_reuse($fields['new_password'])){ |
|
| 165 | + if (!$accounthelper->check_password_reuse($fields['new_password'])) { |
|
| 166 | 166 | $result['new_password'] = $accounthelper->errstr; |
| 167 | - } elseif (!$accounthelper->check_password_strength($fields['new_password'])){ |
|
| 167 | + } elseif (!$accounthelper->check_password_strength($fields['new_password'])) { |
|
| 168 | 168 | $result['new_password'] = $accounthelper->errstr; |
| 169 | 169 | } |
| 170 | 170 | return $result ?: true; |
@@ -185,7 +185,8 @@ |
||
| 185 | 185 | |
| 186 | 186 | try { |
| 187 | 187 | $account = new midcom_core_account($person); |
| 188 | - } catch (midcom_error) { |
|
| 188 | + } |
|
| 189 | + catch (midcom_error) { |
|
| 189 | 190 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), sprintf($this->_l10n->get('failed to get the user with id %s'), $person->id), 'error'); |
| 190 | 191 | return; |
| 191 | 192 | } |
@@ -90,7 +90,8 @@ |
||
| 90 | 90 | if ($request->request->has('midcom_helper_datamanager2_save')) { |
| 91 | 91 | try { |
| 92 | 92 | $rules = $this->_load_rules($request); |
| 93 | - } catch (midcom_error $e) { |
|
| 93 | + } |
|
| 94 | + catch (midcom_error $e) { |
|
| 94 | 95 | midcom::get()->uimessages->add($this->_component, $this->_l10n->get($e->getMessage()), 'error'); |
| 95 | 96 | return; |
| 96 | 97 | } |
@@ -82,7 +82,8 @@ discard block |
||
| 82 | 82 | try { |
| 83 | 83 | $object1 = $this->load($param->parentguid); |
| 84 | 84 | $object2 = $this->load($param->name); |
| 85 | - } catch (midcom_error) { |
|
| 85 | + } |
|
| 86 | + catch (midcom_error) { |
|
| 86 | 87 | $i++; |
| 87 | 88 | continue; |
| 88 | 89 | } |
@@ -160,7 +161,8 @@ discard block |
||
| 160 | 161 | try { |
| 161 | 162 | $merger = new org_openpsa_contacts_duplicates_merge($this->mode, $this->_config); |
| 162 | 163 | $merger->merge_delete($object1, $object2); |
| 163 | - } catch (midcom_error $e) { |
|
| 164 | + } |
|
| 165 | + catch (midcom_error $e) { |
|
| 164 | 166 | // TODO: Localize |
| 165 | 167 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), 'Merge failed, errstr: ' . $e->getMessage(), 'error'); |
| 166 | 168 | } |