src/Neutrino/Error/Error.php
function jsonSerialize()
    {
        $json = $this->attributes;

        if ($this->attributes['isException']) {
            /** @var \Exception $exception */
            $exception         = $this->attributes['exception'];
            $json['exception'] = [
                'class'   => get_class($exception),
                'code'    => $exception->getCode(),
                'message' => $exception->getMessage(),
                'traces'  => Helper::formatExceptionTrace($exception)
            ];
        }

        return $json;
    }
function jsonSerialize()
    {
        $json = $this->attributes;

        if ($this->attributes['isException']) {
            /** @var \Exception $exception */
            $exception         = $this->attributes['exception'];
            $json['exception'] = [
                'class'   => get_class($exception),
                'code'    => $exception->getCode(),
                'message' => $exception->getMessage(),
                'traces'  => Helper::formatExceptionTrace($exception)
            ];
        }

        return $json;
    }
Specify data which should be serialized to JSON

@link  http://php.net/manual/en/jsonserializable.jsonserialize.php
@return mixed data which can be serialized by <b>json_encode</b>,
which is a value of any type other than a resource.
@since 5.4.0