Exceptions

This file contains custom Exceptions that are used within the CloudCIX API library

class cloudcix.exceptions.CloudCIXAuthException(error_code, detail)
This exception is raised when there are errors returned from the methods used to generate Tokens;
  • cloudcix.auth.get_token

  • cloudcix.auth.get_admin_token

The exception will contain both an error_code and detail field, giving information on the error itself.

class cloudcix.exceptions.ImproperlyConfiguredException

This exception is raised when the CloudCIX library has not been properly configured.

This can usually happen in the following ways:

  • The settings file has not been specified in the environment variables

  • The settings file is missing a required setting (see Required Settings)

class cloudcix.exceptions.MissingClientKeywordArgumentException(name, cli)

This exception is raised when a method is called on a service that requires one or more keyword arguments that were not supplied by the user.

For example: if a service’s URL is address/{address_id}/link/, the call to Membership.address_link.list must include an address_id keyword argument, or else this exception will be thrown.

The message for the exception will look like this; The "address_id" keyword argument is required by <Client [{.../address/{address_id}/link/}]>.

__init__(name, cli)

Initialize an instance of the exception

Parameters:
  • name (str) – The name of the keyword argument that is missing

  • cli (cloudcix.client.Client) – The Client instance that is missing the keyword argument