errors Module

exception classes.

exception restkit.errors.AlreadyRead

Bases: exceptions.Exception

raised when a response have already been read

exception restkit.errors.BadStatusLine

Bases: exceptions.Exception

Exception returned by the parser when the status line is invalid

exception restkit.errors.ChunkMissingTerminator(term)

Bases: restkit.errors.ParseException

exception restkit.errors.HeaderLimit

Bases: restkit.errors.ParseException

exception raised when we gore more headers than max_header_count

exception restkit.errors.InvalidChunkSize(data)

Bases: restkit.errors.ParseException

exception restkit.errors.InvalidHTTPStatus(status)

Bases: restkit.errors.ParseException

exception restkit.errors.InvalidHTTPVersion(version)

Bases: restkit.errors.ParseException

exception restkit.errors.InvalidHeader(hdr)

Bases: restkit.errors.ParseException

exception restkit.errors.InvalidHeaderName(hdr)

Bases: restkit.errors.ParseException

exception restkit.errors.InvalidRequestLine(req)

Bases: restkit.errors.ParseException

exception restkit.errors.InvalidRequestMethod(method)

Bases: restkit.errors.ParseException

exception restkit.errors.InvalidUrl

Bases: exceptions.Exception

Not a valid url for use with this software.

exception restkit.errors.NoMoreData(buf=None)

Bases: restkit.errors.ParseException

exception restkit.errors.ParseException

Bases: exceptions.Exception

exception restkit.errors.ParserError

Bases: exceptions.Exception

Generic exception returned by the parser

exception restkit.errors.ProxyError

Bases: exceptions.Exception

exception restkit.errors.RedirectLimit

Bases: exceptions.Exception

Exception raised when the redirection limit is reached.

exception restkit.errors.RequestError

Bases: exceptions.Exception

Exception raised when a request is malformed

exception restkit.errors.RequestFailed(msg=None, http_code=None, response=None)

Bases: restkit.errors.ResourceError

Exception raised when an unexpected HTTP error is received in response to a request.

The request failed, meaning the remote HTTP server returned a code other than success, unauthorized, or NotFound.

The exception message attempts to extract the error

You can get the status code by e.status_int, or see anything about the response via e.response. For example, the entire result body (which is probably an HTML error page) is e.response.body.

exception restkit.errors.RequestTimeout

Bases: exceptions.Exception

Exception raised on socket timeout

exception restkit.errors.ResourceError(msg=None, http_code=None, response=None)

Bases: exceptions.Exception

default error class

message
status_int = None
exception restkit.errors.ResourceGone(msg=None, http_code=None, response=None)

Bases: restkit.errors.ResourceError

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11

status_int = 410
exception restkit.errors.ResourceNotFound(msg=None, http_code=None, response=None)

Bases: restkit.errors.ResourceError

Exception raised when no resource was found at the given url.

status_int = 404
exception restkit.errors.ResponseError

Bases: exceptions.Exception

Error raised while getting response or decompressing response stream

exception restkit.errors.Unauthorized(msg=None, http_code=None, response=None)

Bases: restkit.errors.ResourceError

Exception raised when an authorization is required to access to the resource specified.

exception restkit.errors.UnexpectedEOF

Bases: exceptions.Exception

exception raised when remote closed the connection