The synaps.exception Module

Synaps base exception handling.

Includes decorator for re-raising Synaps-type exceptions.

SHOULD include dedicated exception logging.

exception AccessKeyNotFound(message=None, **kwargs)

Bases: synaps.exception.ResourceNotFound

message = 'Access Key %(access_key)s could not be found.'
exception AdminRequired(message=None, **kwargs)

Bases: synaps.exception.NotAuthorized

code = 403
message = 'User does not have admin privileges'
exception ClassNotFound(message=None, **kwargs)

Bases: synaps.exception.ResourceNotFound

message = 'Class %(class_name)s could not be found: %(exception)s'
exception CloudwatchAPIError(message='Unknown', code=None)

Bases: synaps.exception.Error

exception ConfigNotFound(message=None, **kwargs)

Bases: synaps.exception.ResourceNotFound

message = 'Could not find config at %(path)s'
exception ConvertedException(code=0, title='', explanation='')

Bases: webob.exc.WSGIHTTPException

exception DBError(inner_exception=None)

Bases: synaps.exception.Error

Wraps an implementation specific exception.

exception DecryptionFailure(message=None, **kwargs)

Bases: synaps.exception.SynapsException

message = 'Failed to decrypt text'
exception Duplicate(message=None, **kwargs)

Bases: synaps.exception.SynapsException

exception Error

Bases: exceptions.Exception

exception GlobalRoleNotAllowed(message=None, **kwargs)

Bases: synaps.exception.NotAllowed

message = 'Unable to use global role %(role_id)s'
exception Invalid(message=None, **kwargs)

Bases: synaps.exception.SynapsException

code = 400
message = 'Unacceptable parameters.'
exception InvalidFormat(message=None, **kwargs)

Bases: synaps.exception.Invalid

message = 'Invalid json format'
exception InvalidKeypair(message=None, **kwargs)

Bases: synaps.exception.Invalid

message = 'Keypair data is invalid'
exception InvalidNextToken(message=None, **kwargs)

Bases: synaps.exception.Invalid

message = 'The next token is invalid UUID format'
exception InvalidNotificationGroup(message=None, **kwargs)

Bases: synaps.exception.Invalid

message = 'Invalid notification group. To register or modify notification group, contact administrator'
exception InvalidParameterValue(message=None, **kwargs)

Bases: synaps.exception.Invalid

message = '%(err)s'
exception InvalidRequest(message=None, **kwargs)

Bases: synaps.exception.Invalid

message = 'The request is invalid.'
exception InvalidSignature(message=None, **kwargs)

Bases: synaps.exception.Invalid

message = 'Invalid signature %(signature)s for user %(user)s.'
exception KeyPairExists(message=None, **kwargs)

Bases: synaps.exception.Duplicate

message = 'Key pair %(key_name)s already exists.'
exception LDAPGroupExists(message=None, **kwargs)

Bases: synaps.exception.Duplicate

message = 'LDAP group %(group)s already exists.'
exception LDAPGroupMembershipNotFound(message=None, **kwargs)

Bases: synaps.exception.NotFound

message = 'LDAP user %(user_id)s is not a member of group %(group_id)s.'
exception LDAPGroupNotFound(message=None, **kwargs)

Bases: synaps.exception.LDAPObjectNotFound

message = 'LDAP group %(group_id)s could not be found.'
exception LDAPMembershipExists(message=None, **kwargs)

Bases: synaps.exception.Duplicate

message = 'User %(uid)s is already a member of the group %(group_dn)s'
exception LDAPObjectNotFound(message=None, **kwargs)

Bases: synaps.exception.NotFound

message = 'LDAP object could not be found'
exception LDAPUserExists(message=None, **kwargs)

Bases: synaps.exception.UserExists

message = 'LDAP user %(user)s already exists.'
exception LDAPUserNotFound(message=None, **kwargs)

Bases: synaps.exception.LDAPObjectNotFound

message = 'LDAP user %(user_id)s could not be found.'
exception MetricAlarmQuotaExceeded(message=None, **kwargs)

Bases: synaps.exception.QuotaExceeded

message = 'Too many alarms for this metric'
exception NotAllowed(message=None, **kwargs)

Bases: synaps.exception.SynapsException

message = 'Action not allowed.'
exception NotAuthorized(message=None, **kwargs)

Bases: synaps.exception.SynapsException

code = 403
message = 'Not authorized.'
exception NotFound(message=None, **kwargs)

Bases: synaps.exception.SynapsException

code = 404
message = 'Resource could not be found.'
exception PasteAppNotFound(message=None, **kwargs)

Bases: synaps.exception.ResourceNotFound

message = "Could not load paste app '%(name)s' from %(path)s"
exception ProcessExecutionError(stdout=None, stderr=None, exit_code=None, cmd=None, description=None)

Bases: exceptions.IOError

exception ProjectAlarmQuotaExceeded(message=None, **kwargs)

Bases: synaps.exception.QuotaExceeded

message = 'Too many alarms for this project'
exception ProjectExists(message=None, **kwargs)

Bases: synaps.exception.Duplicate

message = 'Project %(project)s already exists.'
exception ProjectMembershipNotFound(message=None, **kwargs)

Bases: synaps.exception.ResourceNotFound

message = 'User %(user_id)s is not a member of project %(project_id)s.'
exception ProjectNotFound(message=None, **kwargs)

Bases: synaps.exception.ResourceNotFound

message = 'Project %(project_id)s could not be found.'
exception QuotaExceeded(message=None, **kwargs)

Bases: synaps.exception.SynapsException

code = 403
message = 'Quota exceeded'
exception ResourceNotFound(message=None, **kwargs)

Bases: synaps.exception.SynapsException

code = 404
message = 'Resource could not be found.'
exception RpcInvokeException(message=None, **kwargs)

Bases: synaps.exception.SynapsException

message = 'Unable to invoke RPC'
exception SynapsException(message=None, **kwargs)

Bases: exceptions.Exception

Base Synaps Exception

To correctly use this class, inherit from it and define a ‘message’ property. That message will get printf’d with the keyword arguments provided to the constructor.

message = 'An unknown exception occurred.'
exception UserExists(message=None, **kwargs)

Bases: synaps.exception.Duplicate

message = 'User %(user)s already exists.'
exception UserRoleNotFound(message=None, **kwargs)

Bases: synaps.exception.ResourceNotFound

message = 'Role %(role_id)s could not be found.'
wrap_db_error(f)
wrap_exception(notifier=None, publisher_id=None, event_type=None, level=None)

This decorator wraps a method to catch any exceptions that may get thrown. It logs the exception as well as optionally sending it to the notification system.

Previous topic

The synaps.crypto Module

Next topic

The synaps.flags Module

This Page