Commit ea73b215 authored by Marc Egger's avatar Marc Egger
Browse files

Refs #12588 catch generic exceptions/errors using Throwable interface

parent cdfe0e66
Pipeline #5409 failed with stages
in 2 minutes and 12 seconds
......@@ -61,7 +61,7 @@ try {
} catch (\DbException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -134,7 +134,7 @@ try {
$modeAnswer = Store::getVar(SIP_MODE_ANSWER, STORE_SIP);
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -22,7 +22,7 @@ try {
$answer = $dirty->process();
} catch (\Exception $e) {
} catch (\Throwable $e) {
// $answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
$answer = [API_STATUS => API_ANSWER_STATUS_ERROR, API_MESSAGE => "Error: " . $e->getMessage()];
}
......
......@@ -34,7 +34,7 @@ try {
} catch (\DownloadException $e) {
$output = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$output = "Exception: " . $e->getMessage();
}
......
......@@ -70,7 +70,7 @@ try {
} catch (\DbException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -51,7 +51,7 @@ try {
} catch (\CodeException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -80,7 +80,7 @@ try {
$answer[API_MESSAGE] = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -24,6 +24,6 @@ try {
$html2pdf->outputHtml2Pdf();
} catch (\Exception $e) {
} catch (\Throwable $e) {
echo "Exception: " . $e->getMessage();
}
......@@ -105,7 +105,7 @@ try {
$status = $e->getHttpStatus();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -94,7 +94,7 @@ try {
} catch (\DbException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -47,7 +47,7 @@ try {
} catch (\DbException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
......@@ -23,7 +23,7 @@ try {
$answer = $typeAhead->process();
} catch (\Exception $e) {
} catch (\Throwable $e) {
// $answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
$answer = [API_TYPEAHEAD_KEY => 'Error', API_TYPEAHEAD_VALUE => "Error: " . $e->getMessage()];
}
......
......@@ -69,7 +69,7 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
ERROR_MESSAGE_TO_USER => "Generic Exception: " . $e->getMessage(),
ERROR_MESSAGE_TO_DEVELOPER => $e->getTraceAsString()]), E_ERROR);
$html = $ee->formatMessage();
} catch (\Error $e) {
} catch (\Throwable $e) {
$ee = new \UserReportException(json_encode([
ERROR_MESSAGE_TO_USER => "Generic Error: " . $e->getMessage(),
ERROR_MESSAGE_TO_DEVELOPER => $e->getTraceAsString()]), E_ERROR);
......
......@@ -47,7 +47,7 @@ try {
} catch (\DbException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment