Always extract extensions from the original error if possible

ref: graphql/graphql-js#2d08496720088dbe65ebea312c8526bd48fb8ee8
This commit is contained in:
Daniel Tschinder 2018-02-13 10:41:04 +01:00
parent cf276340a4
commit 6d45a22ba4

View File

@ -173,7 +173,11 @@ class Error extends \Exception implements \JsonSerializable, ClientAware
$this->source = $source;
$this->positions = $positions;
$this->path = $path;
$this->extensions = $extensions;
$this->extensions = $extensions ?: (
$previous && $previous instanceof self
? $previous->extensions
: []
);
if ($previous instanceof ClientAware) {
$this->isClientSafe = $previous->isClientSafe();