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();