Errors

exception freshbooks.errors.FreshBooksClientConfigError

Bases: Exception

Exception thrown when optional client parameters are not set, but and required.

with_traceback()

Exception.with_traceback(tb) – set self.**traceback** to tb and return self.

exception freshbooks.errors.FreshBooksError(status_code, message, raw_response=None, error_code=None)

Bases: Exception

Exception thrown when FreshBooks returns a non-2xx response or when the response is missing expected content.

Example:

try:
    client = freshBooksClient.clients.get(self.account_id, client_id)
except FreshBooksError as e:
    assert str(e) == "Client not found."
    assert e.status_code == 404
    assert e.error_code == 1012

Attributes: message: Error message status_code: HTTP status code from the server. error_code: (Optional) FreshBooks specific error code, if available raw_response: Content response from the server.

with_traceback()

Exception.with_traceback(tb) – set self.**traceback** to tb and return self.

exception freshbooks.errors.FreshBooksNotImplementedError(resource_name, method_name)

Bases: Exception

Exception thrown when making a resource call that does not exist. Eg.

>>> freshBooksClient.staff.create()
with_traceback()

Exception.with_traceback(tb) – set self.**traceback** to tb and return self.