protected function normalize($value)
    {
        if ($value instanceof Exception) {
            $value = [
                'class'     => get_class($value),
                'message'   => $value->getMessage(),
                'code'      => $value->getCode(),
                'file'      => $value->getFile(),
                'line'      => $value->getLine(),
            ];
        }

        return $value;
    }