Base class for errors that happen while processing a request.
def google.appengine.tools.devappserver2.endpoints.errors.RequestError.domain |
( |
|
self | ) |
|
Get the domain for this error.
Returns:
The string 'global' by default. Subclasses can override this if they have
a different domain.
def google.appengine.tools.devappserver2.endpoints.errors.RequestError.extra_fields |
( |
|
self | ) |
|
Return a dict of extra fields to add to the error response.
Some errors have additional information. This provides a way for subclasses
to provide that information.
Returns:
None, by default. Subclasses can return a dict with values to add
to the error response.
def google.appengine.tools.devappserver2.endpoints.errors.RequestError.message |
( |
|
self | ) |
|
Text message explaining the error.
Subclasses must implement this, returning a string that explains the
error.
Raises:
NotImplementedError: Subclasses must override this function.
def google.appengine.tools.devappserver2.endpoints.errors.RequestError.reason |
( |
|
self | ) |
|
Get the reason for the error.
Error reason is a custom string in the Cloud Endpoints server. When
possible, this should match the reason that the live server will generate,
based on the error's status code. If this returns None, the error formatter
will attempt to generate a reason from the status code.
Returns:
None, by default. Subclasses can override this if they have a specific
error reason.
def google.appengine.tools.devappserver2.endpoints.errors.RequestError.rest_error |
( |
|
self | ) |
|
Format this error into a response to a REST request.
Returns:
A string containing the reformatted error response.
def google.appengine.tools.devappserver2.endpoints.errors.RequestError.rpc_error |
( |
|
self | ) |
|
Format this error into a response to a JSON RPC request.
Returns:
A dict containing the reformatted JSON error response.
def google.appengine.tools.devappserver2.endpoints.errors.RequestError.status_code |
( |
|
self | ) |
|
HTTP status code number associated with this error.
Subclasses must implement this, returning an integer with the status
code number for the error.
Example: 400
Raises:
NotImplementedError: Subclasses must override this function.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/tools/devappserver2/endpoints/errors.py