Exceptions

exception TheNounProjectAPI.exceptions.APIException(response, description)

Bases: Exception

Base exception for all exceptions related to status codes within this package.

exception TheNounProjectAPI.exceptions.ServerException(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate issues on server side.

exception TheNounProjectAPI.exceptions.BadRequest(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate invalid parameters for the request.

exception TheNounProjectAPI.exceptions.Unauthorized(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate missing or incorrect authentication for the request.

exception TheNounProjectAPI.exceptions.Forbidden(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate that this request is not permitted.

exception TheNounProjectAPI.exceptions.NotFound(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate that the requested URL cannot be found.

exception TheNounProjectAPI.exceptions.Redirect(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate that the request resulted in a redirect.

exception TheNounProjectAPI.exceptions.LegalReasons(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate that the requested URL is not available for legal reasons.

exception TheNounProjectAPI.exceptions.RateLimited(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate that the requestee may have been rate limited.

exception TheNounProjectAPI.exceptions.UnknownStatusCode(response)

Bases: TheNounProjectAPI.exceptions.APIException

Indicate that the encountered status code is not a code we have a proper response/exception to.

exception TheNounProjectAPI.exceptions.ParameterException(parameter, description)

Bases: Exception

Base exception for all exceptions related to incorrect parameters within this package.

exception TheNounProjectAPI.exceptions.IncorrectType(parameter, param_type)

Bases: TheNounProjectAPI.exceptions.ParameterException

Indicate that the parameter must be of param_type type.

exception TheNounProjectAPI.exceptions.NonPositive(parameter)

Bases: TheNounProjectAPI.exceptions.ParameterException

Indicate that the parameter must be a positive integer.

exception TheNounProjectAPI.exceptions.IllegalSlug(parameter)

Bases: TheNounProjectAPI.exceptions.ParameterException

Indicate that the parameter does not follow the rules for a slug:

  • parameter must be a nonempty string.

  • parameter must only contain ascii characters.

  • parameter must not contain multiple words.

exception TheNounProjectAPI.exceptions.IllegalTerm(parameter)

Bases: TheNounProjectAPI.exceptions.ParameterException

Indicate that the parameter does not follow the rules for a term:

  • parameter must be a nonempty string.

exception TheNounProjectAPI.exceptions.APIKeyNotSet(parameter)

Bases: TheNounProjectAPI.exceptions.ParameterException

Indicate that the parameter key has not been set properly.