src/Traits/MicroServiceExceptionHandlerTrait.php
public function handleMicroServiceException(Exception $e)
    {
        // Determine the status code and message to return.
        if ($e instanceof HttpException) {
            return $this->handleHttpException($e);
        } elseif ($e instanceof ModelNotFoundException) {
            return $this->handleModelNotFoundException($e);
        } elseif ($e instanceof ValidationException) {
            return $this->handleValidationException($e);
        } else {
            return $this->handleGenericException($e);
        }
    }
public function handleMicroServiceException(Exception $e)
    {
        // Determine the status code and message to return.
        if ($e instanceof HttpException) {
            return $this->handleHttpException($e);
        } elseif ($e instanceof ModelNotFoundException) {
            return $this->handleModelNotFoundException($e);
        } elseif ($e instanceof ValidationException) {
            return $this->handleValidationException($e);
        } else {
            return $this->handleGenericException($e);
        }
    }
public function handleMicroServiceException ( Exception $ e ) { // Determine the status code and message to return. if ( $ e instanceof HttpException ) { return $ this -> handleHttpException ( $ e ) ; } elseif ( $ e instanceof ModelNotFoundException ) { return $ this -> handleModelNotFoundException ( $ e ) ; } elseif ( $ e instanceof ValidationException ) { return $ this -> handleValidationException ( $ e ) ; } else { return $ this -> handleGenericException ( $ e ) ; } }
Handle the exception and produce a valid JSON response.

@param Exception $e
@return \Illuminate\Http\JsonResponse
Handle the exception and produce a valid JSON response .