@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -104,7 +104,8 @@ |
||
104 | 104 | { |
105 | 105 | $ret = ['org_openpsa_relatedto' => []]; |
106 | 106 | foreach ($array as $rel) { |
107 | - if (!midcom::get()->dbfactory->is_a($rel, org_openpsa_relatedto_dba::class)) { //Matches also 'org_openpsa_relatedto' |
|
107 | + if (!midcom::get()->dbfactory->is_a($rel, org_openpsa_relatedto_dba::class)) { |
|
108 | +//Matches also 'org_openpsa_relatedto' |
|
108 | 109 | //Wrong type of object found in array, cruelly abort the whole procedure |
109 | 110 | return null; |
110 | 111 | } |
@@ -102,7 +102,8 @@ |
||
102 | 102 | try { |
103 | 103 | $mgdschemaclass = $this->__mgdschema_class_name__; |
104 | 104 | $this->set_object(new $mgdschemaclass($id)); |
105 | - } catch (mgd_exception $e) { |
|
105 | + } |
|
106 | + catch (mgd_exception $e) { |
|
106 | 107 | debug_add('Constructing ' . $this->__mgdschema_class_name__ . ' object ' . $id . ' failed, reason: ' . $e->getMessage(), MIDCOM_LOG_WARN); |
107 | 108 | throw new midcom_error_midgard($e, $id); |
108 | 109 | } |
@@ -40,7 +40,8 @@ discard block |
||
40 | 40 | foreach ($items as $identifier => $guid) { |
41 | 41 | try { |
42 | 42 | $results[$identifier] = new midcom_db_attachment($guid); |
43 | - } catch (midcom_error $e) { |
|
43 | + } |
|
44 | + catch (midcom_error $e) { |
|
44 | 45 | $e->log(); |
45 | 46 | } |
46 | 47 | } |
@@ -193,7 +194,8 @@ discard block |
||
193 | 194 | foreach (self::load_map($object, $field) as $identifier => $guid) { |
194 | 195 | try { |
195 | 196 | $attachments[$identifier] = midcom_db_attachment::get_cached($guid); |
196 | - } catch (midcom_error $e) { |
|
197 | + } |
|
198 | + catch (midcom_error $e) { |
|
197 | 199 | $e->log(); |
198 | 200 | } |
199 | 201 | } |
@@ -116,7 +116,8 @@ |
||
116 | 116 | try { |
117 | 117 | $object = $options['widget_config']['class']::get_cached($identifier); |
118 | 118 | $preset[$identifier] = autocomplete_helper::create_item_label($object, $options['widget_config']['result_headers'], $options['widget_config']['titlefield']); |
119 | - } catch (midcom_error $e) { |
|
119 | + } |
|
120 | + catch (midcom_error $e) { |
|
120 | 121 | $e->log(); |
121 | 122 | } |
122 | 123 | } |
@@ -64,7 +64,8 @@ |
||
64 | 64 | try { |
65 | 65 | $this->__object = $this->__midcom_class_name__::get_cached($this->__identifier); |
66 | 66 | return true; |
67 | - } catch (midcom_error $e) { |
|
67 | + } |
|
68 | + catch (midcom_error $e) { |
|
68 | 69 | $e->log(); |
69 | 70 | } |
70 | 71 | return false; |
@@ -575,7 +575,8 @@ |
||
575 | 575 | $param = $param->__object; |
576 | 576 | } |
577 | 577 | $this->_group_cache[$id] = new midcom_core_group($param); |
578 | - } catch (midcom_error $e) { |
|
578 | + } |
|
579 | + catch (midcom_error $e) { |
|
579 | 580 | debug_add("Group with identifier {$id} could not be loaded: " . $e->getMessage(), MIDCOM_LOG_WARN); |
580 | 581 | $this->_group_cache[$id] = null; |
581 | 582 | } |