@@ -55,7 +55,8 @@ |
||
| 55 | 55 | { |
| 56 | 56 | try { |
| 57 | 57 | return eval("return [{$data}\n];"); |
| 58 | - } catch (ParseError $e) { |
|
| 58 | + } |
|
| 59 | + catch (ParseError $e) { |
|
| 59 | 60 | throw new midcom_error('Failed to parse config data: ' . $e->getMessage() . ' in ' . $path . ' line ' . $e->getLine()); |
| 60 | 61 | } |
| 61 | 62 | } |
@@ -17,7 +17,8 @@ |
||
| 17 | 17 | foreach ($data['objects'] as $guid => $privs) { |
| 18 | 18 | try { |
| 19 | 19 | $object = new midcom_db_topic($guid); |
| 20 | - } catch (midcom_error $e) { |
|
| 20 | + } |
|
| 21 | + catch (midcom_error $e) { |
|
| 21 | 22 | continue; |
| 22 | 23 | } |
| 23 | 24 | echo "<tr>\n"; |
@@ -79,7 +79,8 @@ discard block |
||
| 79 | 79 | try { |
| 80 | 80 | $dms['group']->set_storage($group); |
| 81 | 81 | org_openpsa_products_viewer::index($dms['group'], $indexer, $topic, $config); |
| 82 | - } catch (midcom_error $e) { |
|
| 82 | + } |
|
| 83 | + catch (midcom_error $e) { |
|
| 83 | 84 | $e->log(MIDCOM_LOG_WARN); |
| 84 | 85 | } |
| 85 | 86 | } |
@@ -91,7 +92,8 @@ discard block |
||
| 91 | 92 | try { |
| 92 | 93 | $dms['product']->set_storage($product); |
| 93 | 94 | org_openpsa_products_viewer::index($dms['product'], $indexer, $topic, $config); |
| 94 | - } catch (midcom_error $e) { |
|
| 95 | + } |
|
| 96 | + catch (midcom_error $e) { |
|
| 95 | 97 | $e->log(MIDCOM_LOG_WARN); |
| 96 | 98 | } |
| 97 | 99 | } |
@@ -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'] = [ |
@@ -421,7 +422,8 @@ discard block |
||
| 421 | 422 | if (!($this->_object instanceof org_openpsa_relatedto_dba)) { |
| 422 | 423 | $response->status = "method requires guid of a link object as an argument"; |
| 423 | 424 | } |
| 424 | - } catch (midcom_error $e) { |
|
| 425 | + } |
|
| 426 | + catch (midcom_error $e) { |
|
| 425 | 427 | $response->status = "error: " . $e->getMessage(); |
| 426 | 428 | } |
| 427 | 429 | |
@@ -444,7 +446,8 @@ discard block |
||
| 444 | 446 | $relation = new org_openpsa_relatedto_dba($guid); |
| 445 | 447 | $response->result = $relation->delete(); |
| 446 | 448 | $response->status = 'Last message: ' . midcom_connection::get_error_string(); |
| 447 | - } catch (midcom_error $e) { |
|
| 449 | + } |
|
| 450 | + catch (midcom_error $e) { |
|
| 448 | 451 | $response->result = false; |
| 449 | 452 | $response->status = "Object '{$guid}' could not be loaded, error:" . $e->getMessage(); |
| 450 | 453 | } |
@@ -33,7 +33,8 @@ |
||
| 33 | 33 | $task_label = "<a href=\"{$data['projects_url']}task/{$task->guid}/\">{$task_label}</a>"; |
| 34 | 34 | } |
| 35 | 35 | echo $task_label; |
| 36 | - } catch (midcom_error $e) {} |
|
| 36 | + } |
|
| 37 | + catch (midcom_error $e) {} |
|
| 37 | 38 | ?> |
| 38 | 39 | </td> |
| 39 | 40 | <td class="multivalue"> |
@@ -25,7 +25,8 @@ |
||
| 25 | 25 | $row['creator_index'] = $creator->rname; |
| 26 | 26 | $creator_card = org_openpsa_widgets_contact::get($entry->metadata->creator); |
| 27 | 27 | $row['creator'] = $creator_card->show_inline(); |
| 28 | - } catch (midcom_error $e) { |
|
| 28 | + } |
|
| 29 | + catch (midcom_error $e) { |
|
| 29 | 30 | $row['creator_index'] = ''; |
| 30 | 31 | $row['creator'] = ''; |
| 31 | 32 | } |
@@ -203,7 +203,8 @@ |
||
| 203 | 203 | if ($object instanceof mgdobject) { |
| 204 | 204 | try { |
| 205 | 205 | $obj = midcom::get()->dbfactory->convert_midgard_to_midcom($object); |
| 206 | - } catch (midcom_error $e) { |
|
| 206 | + } |
|
| 207 | + catch (midcom_error $e) { |
|
| 207 | 208 | return null; |
| 208 | 209 | } |
| 209 | 210 | } else { |
@@ -143,7 +143,8 @@ |
||
| 143 | 143 | debug_add('person #' . $person->id . 'has no email address, aborting'); |
| 144 | 144 | return null; |
| 145 | 145 | } |
| 146 | - } catch (midcom_error $e) { |
|
| 146 | + } |
|
| 147 | + catch (midcom_error $e) { |
|
| 147 | 148 | return null; |
| 148 | 149 | } |
| 149 | 150 | |
@@ -48,7 +48,8 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | try { |
| 50 | 50 | $folder = midcom_db_topic::get_cached($this->topic); |
| 51 | - } catch (midcom_error $e) { |
|
| 51 | + } |
|
| 52 | + catch (midcom_error $e) { |
|
| 52 | 53 | $e->log(); |
| 53 | 54 | } |
| 54 | 55 | $folder->delete_attachment(self::FOLDER_THUMBNAIL); |
@@ -58,7 +59,8 @@ discard block |
||
| 58 | 59 | { |
| 59 | 60 | try { |
| 60 | 61 | return new midcom_db_attachment($this->$type); |
| 61 | - } catch (midcom_error $e) { |
|
| 62 | + } |
|
| 63 | + catch (midcom_error $e) { |
|
| 62 | 64 | $e->log(); |
| 63 | 65 | return null; |
| 64 | 66 | } |