Check if an exception is internal before rethrowing

This commit is contained in:
Benedikt Franke 2018-08-31 17:45:41 +02:00 committed by GitHub
parent ec54d6152b
commit 503ac4619a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,7 +235,9 @@ class FormattedError
$debug = (int) $debug; $debug = (int) $debug;
if ($debug & Debug::RETHROW_INTERNAL_EXCEPTIONS) { $isInternal = ! $e instanceof ClientAware || ! $e->isClientSafe();
if (($debug & Debug::RETHROW_INTERNAL_EXCEPTIONS) && $isInternal) {
if (! $e instanceof Error) { if (! $e instanceof Error) {
throw $e; throw $e;
} }
@ -245,8 +247,6 @@ class FormattedError
} }
} }
$isInternal = ! $e instanceof ClientAware || ! $e->isClientSafe();
if (($debug & Debug::INCLUDE_DEBUG_MESSAGE) && $isInternal) { if (($debug & Debug::INCLUDE_DEBUG_MESSAGE) && $isInternal) {
// Displaying debugMessage as a first entry: // Displaying debugMessage as a first entry:
$formattedError = ['debugMessage' => $e->getMessage()] + $formattedError; $formattedError = ['debugMessage' => $e->getMessage()] + $formattedError;