src/Api/Response/RestResponseBuilder.php
protected function formatExceptionErrorForLocal(Exception $e, $fallbackMessage = null)
    {
        $message = $e->getMessage() ?: $fallbackMessage;

        return [
            'message' => $message,
            'code'    => $e->getCode(),
            'file'    => $e->getFile(),
            'line'    => $e->getLine(),
            'trace'   => array_map(function($trace) {
                return trim(
                    (isset($trace['file']) ? $trace['file'] . ' : ' . $trace['line'] : '')
                    . '   '
                    . (isset($trace['function']) ? $trace['function']
                        . (isset($trace['class']) ? ' on ' . $trace['class'] : '')
                    : '')
                );
            }, $e->getTrace()),
        ];
    }
protected function formatExceptionErrorForLocal(Exception $e, $fallbackMessage = null)
    {
        $message = $e->getMessage() ?: $fallbackMessage;

        return [
            'message' => $message,
            'code'    => $e->getCode(),
            'file'    => $e->getFile(),
            'line'    => $e->getLine(),
            'trace'   => array_map(function($trace) {
                return trim(
                    (isset($trace['file']) ? $trace['file'] . ' : ' . $trace['line'] : '')
                    . '   '
                    . (isset($trace['function']) ? $trace['function']
                        . (isset($trace['class']) ? ' on ' . $trace['class'] : '')
                    : '')
                );
            }, $e->getTrace()),
        ];
    }
protected function formatExceptionErrorForLocal ( Exception $ e , $ fallbackMessage = null ) { $ message = $ e -> getMessage ( ) ? : $ fallbackMessage ; return [ 'message' => $ message , 'code' => $ e -> getCode ( ) , 'file' => $ e -> getFile ( ) , 'line' => $ e -> getLine ( ) , 'trace' => array_map ( function ( $ trace ) { return trim ( ( isset ( $ trace [ 'file' ] ) ? $ trace [ 'file' ] . ' : ' . $ trace [ 'line' ] : '' ) . '   ' . ( isset ( $ trace [ 'function' ] ) ? $ trace [ 'function' ] . ( isset ( $ trace [ 'class' ] ) ? ' on ' . $ trace [ 'class' ] : '' ) : '' ) ) ; } , $ e -> getTrace ( ) ) , ] ; }
Formats an exception as a standardized error response for local environment only.

@param Exception   $e
@param null|string $fallbackMessage  message to use if exception has none
@return mixed
Formats an exception as a standardized error response for local environment only .