From 6d45a22ba4cead02ff4cc0b914619483e0a25062 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 13 Feb 2018 10:41:04 +0100 Subject: [PATCH] Always extract extensions from the original error if possible ref: graphql/graphql-js#2d08496720088dbe65ebea312c8526bd48fb8ee8 --- src/Error/Error.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Error/Error.php b/src/Error/Error.php index 3694592..ac931bf 100644 --- a/src/Error/Error.php +++ b/src/Error/Error.php @@ -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();