influxdb/influxdb-python — pull request #33 by prune998 (2014-05-23 15:35:57+00:00)
Title: add the status code in the Request exception

Create a InfluxDBClientError class as Exception
This will give allow 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.
This may be a breaking change for some if they already parse the message.

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
}
}