You are here

class RestWSException in RESTful Web Services 7

Same name and namespace in other branches
  1. 7.2 restws.module \RestWSException

An exception defining the HTTP error code and message.

Hierarchy

Expanded class hierarchy of RestWSException

File

./restws.module, line 156
RESTful web services module.

View source
class RestWSException extends Exception {
  public function getHTTPError() {
    $code = $this
      ->getCode();
    switch ($code) {
      case 403:
        return '403 Forbidden';
      case 404:
        return '404 Not Found';
      case 406:
        return '406 Not Acceptable';
      case 422:
        return '422 Unprocessable Entity';
      default:
        return '500 Internal Server Error';
    }
  }

}

Members