public function handleError(Error\Base $ex)
    {
        // build response body
        $body = [
            'type' => $this->singularClassName($ex),
            'message' => $ex->getMessage(),
        ];

        if ($ex instanceof InvalidRequest && $param = $ex->getParam()) {
            $body['param'] = $param;
        }

        // set HTTP status code
        $this->response->setCode($ex->getHttpStatus());

        return $body;
    }
public function handleError(Error\Base $ex)
    {
        // build response body
        $body = [
            'type' => $this->singularClassName($ex),
            'message' => $ex->getMessage(),
        ];

        if ($ex instanceof InvalidRequest && $param = $ex->getParam()) {
            $body['param'] = $param;
        }

        // set HTTP status code
        $this->response->setCode($ex->getHttpStatus());

        return $body;
    }
public function handleError ( Error \ Base $ ex ) { // build response body $ body = [ 'type' => $ this -> singularClassName ( $ ex ) , 'message' => $ ex -> getMessage ( ) , ] ; if ( $ ex instanceof InvalidRequest && $ param = $ ex -> getParam ( ) ) { $ body [ 'param' ] = $ param ; } // set HTTP status code $ this -> response -> setCode ( $ ex -> getHttpStatus ( ) ) ; return $ body ; }
Handles exceptions thrown in this route.

@param Error\Base $ex

@return mixed
Handles exceptions thrown in this route .