mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-25 06:16:05 +03:00
Check if an exception is internal before rethrowing
This commit is contained in:
parent
ec54d6152b
commit
503ac4619a
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user