private function serializeException(\Exception $exception)
    {
        return [
            'message' => $exception->getMessage(),
            'code' => $exception->getCode(),
            'trace' => $exception->getTrace(),
            'file' => $exception->getFile(),
            'line' => $exception->getLine(),
            'previous' => null !== $exception->getPrevious() ? $this->serializeException($exception->getPrevious()) : null,
        ];
    }
private function serializeException(\Exception $exception)
    {
        return [
            'message' => $exception->getMessage(),
            'code' => $exception->getCode(),
            'trace' => $exception->getTrace(),
            'file' => $exception->getFile(),
            'line' => $exception->getLine(),
            'previous' => null !== $exception->getPrevious() ? $this->serializeException($exception->getPrevious()) : null,
        ];
    }
private function serializeException ( \ Exception $ exception ) { return [ 'message' => $ exception -> getMessage ( ) , 'code' => $ exception -> getCode ( ) , 'trace' => $ exception -> getTrace ( ) , 'file' => $ exception -> getFile ( ) , 'line' => $ exception -> getLine ( ) , 'previous' => null !== $ exception -> getPrevious ( ) ? $ this -> serializeException ( $ exception -> getPrevious ( ) ) : null , ] ; }
Serializes exception.

@param \Exception $exception

@return array
Serializes exception .