protected function toDebugResponse( RequestInterface $request, PhpException $exception ) {
		if ( $request->isAjax() ) {
			return Response::json( [
				'message' => $exception->getMessage(),
				'exception' => get_class( $exception ),
				'file' => $exception->getFile(),
				'line' => $exception->getLine(),
				'trace' => array_map( function ( $trace ) {
					return Arr::except( $trace, ['args'] );
				}, $exception->getTrace() ),
			] )->withStatus( 500 );
		}

		if ( $this->whoops !== null ) {
			return $this->toPrettyErrorResponse( $exception );
		}

		throw $exception;
	}
protected function toDebugResponse( RequestInterface $request, PhpException $exception ) {
		if ( $request->isAjax() ) {
			return Response::json( [
				'message' => $exception->getMessage(),
				'exception' => get_class( $exception ),
				'file' => $exception->getFile(),
				'line' => $exception->getLine(),
				'trace' => array_map( function ( $trace ) {
					return Arr::except( $trace, ['args'] );
				}, $exception->getTrace() ),
			] )->withStatus( 500 );
		}

		if ( $this->whoops !== null ) {
			return $this->toPrettyErrorResponse( $exception );
		}

		throw $exception;
	}
protected function toDebugResponse ( RequestInterface $ request , PhpException $ exception ) { if ( $ request -> isAjax ( ) ) { return Response :: json ( [ 'message' => $ exception -> getMessage ( ) , 'exception' => get_class ( $ exception ) , 'file' => $ exception -> getFile ( ) , 'line' => $ exception -> getLine ( ) , 'trace' => array_map ( function ( $ trace ) { return Arr :: except ( $ trace , [ 'args' ] ) ; } , $ exception -> getTrace ( ) ) , ] ) -> withStatus ( 500 ) ; } if ( $ this -> whoops !== null ) { return $ this -> toPrettyErrorResponse ( $ exception ) ; } throw $ exception ; }
Convert an exception to a debug ResponseInterface instance if possible.

@throws PhpException
@param  RequestInterface  $request
@param  PhpException      $exception
@return ResponseInterface
Convert an exception to a debug ResponseInterface instance if possible .