You are here

public function RestWSException::getHTTPError in RESTful Web Services 7.2

Same name and namespace in other branches
  1. 7 restws.module \RestWSException::getHTTPError()

File

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

Class

RestWSException
An exception defining the HTTP error code and message.

Code

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 412:
      return '412 Precondition Failed';
    case 422:
      return '422 Unprocessable Entity';
    default:
      return '500 Internal Server Error';
  }
}