influxdb/influxdb-python — pull request #32 by prune998 (2014-05-23 14:44:05+00:00)
Title: add the status code in the Request exception

This will give something similar to an HTTPError, including code and message instead of just message.
It will make it easier to parse the exception, for example when trying to create a database that already exists.

FYI, messages and codes are defined in Influxdb as :

func errorToStatusCode(err error) int {
switch err.(type) {
case AuthenticationError:
return libhttp.StatusUnauthorized // HTTP 401
case AuthorizationError:
return libhttp.StatusForbidden // HTTP 403
case DatabaseExistsError:
return libhttp.StatusConflict // HTTP 409
default:
return libhttp.StatusBadRequest // HTTP 400
}
}