original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Handles exceptions thrown in this route.
  
  @param Error\Base $ex
  
  @return mixed
docstring_tokens: Handles exceptions thrown in this route .