Skip to content
Snippets Groups Projects
Commit 7854bf34 authored by Marc Egger's avatar Marc Egger
Browse files

Revert "Revert "remove new error catch syntax with '|' since gitlab runner PHP does not support""

This reverts commit ec46cdf0
parent 72df1995
No related branches found
No related tags found
2 merge requests!302Develop,!296Marc: Form/Report As File, Path class, Config class, Typo3 v9 compatability
Pipeline #3947 failed
...@@ -175,7 +175,9 @@ class AbstractException extends \Exception { ...@@ -175,7 +175,9 @@ class AbstractException extends \Exception {
$arrMerged[ERROR_MESSAGE_TO_DEVELOPER] = QuickFormQuery::buildInlineReport(\UserReportException::$report_uid, $arrMerged[ERROR_MESSAGE_TO_DEVELOPER] = QuickFormQuery::buildInlineReport(\UserReportException::$report_uid,
\UserReportException::$report_pathFileName, \UserReportException::$report_bodytext, \UserReportException::$report_pathFileName, \UserReportException::$report_bodytext,
\UserReportException::$report_header) . $arrMerged[ERROR_MESSAGE_TO_DEVELOPER]; \UserReportException::$report_header) . $arrMerged[ERROR_MESSAGE_TO_DEVELOPER];
} catch (\Error | \Exception $e) { } catch (\Error $e) {
$arrMerged[ERROR_MESSAGE_TO_DEVELOPER] .= "<br>(inline report editor not available)";
} catch (\Exception $e) {
$arrMerged[ERROR_MESSAGE_TO_DEVELOPER] .= "<br>(inline report editor not available)"; $arrMerged[ERROR_MESSAGE_TO_DEVELOPER] .= "<br>(inline report editor not available)";
} }
......
...@@ -64,7 +64,9 @@ class ColumnScript { ...@@ -64,7 +64,9 @@ class ColumnScript {
// this will be caught bellow // this will be caught bellow
throw new \Exception('Include failed.'); throw new \Exception('Include failed.');
} }
} catch (\Exception | \Error $e) { } catch (\Exception $e) {
Thrower::userReportException('Error during reading script file.', "Error message:\n" . $e->getMessage());
} catch (\Error $e) {
Thrower::userReportException('Error during reading script file.', "Error message:\n" . $e->getMessage()); Thrower::userReportException('Error during reading script file.', "Error message:\n" . $e->getMessage());
} }
...@@ -76,7 +78,11 @@ class ColumnScript { ...@@ -76,7 +78,11 @@ class ColumnScript {
try { try {
$return = call_user_func_array($param[TOKEN_FUNCTION_CALL], [$param, new ScriptFunctions()]); $return = call_user_func_array($param[TOKEN_FUNCTION_CALL], [$param, new ScriptFunctions()]);
$output = ob_get_clean(); $output = ob_get_clean();
} catch (\Exception | \Error $e) { } catch (\Exception $e) {
ob_end_clean();
Thrower::userReportException('Function execution failed.',
"Error message:\n" . $e->getMessage() . "\n\nFunction: " . $param[TOKEN_FUNCTION_CALL] . "\n\nParameters:\n" . print_r($param,true));
} catch (\Error $e) {
ob_end_clean(); ob_end_clean();
Thrower::userReportException('Function execution failed.', Thrower::userReportException('Function execution failed.',
"Error message:\n" . $e->getMessage() . "\n\nFunction: " . $param[TOKEN_FUNCTION_CALL] . "\n\nParameters:\n" . print_r($param,true)); "Error message:\n" . $e->getMessage() . "\n\nFunction: " . $param[TOKEN_FUNCTION_CALL] . "\n\nParameters:\n" . print_r($param,true));
......
...@@ -414,7 +414,9 @@ try { ...@@ -414,7 +414,9 @@ try {
} catch (\DownloadException $e) { } catch (\DownloadException $e) {
$html = $e->formatMessage(); $html = $e->formatMessage();
} catch (\Error | \Exception $e) { } catch (\Error $e) {
$html = "Generic Exception: " . $e->getMessage() . (IS_DEBUG ? ("<br>" . nl2br($e->getTraceAsString())) : '');
} catch (\Exception $e) {
$html = "Generic Exception: " . $e->getMessage() . (IS_DEBUG ? ("<br>" . nl2br($e->getTraceAsString())) : ''); $html = "Generic Exception: " . $e->getMessage() . (IS_DEBUG ? ("<br>" . nl2br($e->getTraceAsString())) : '');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment