Payments / Client / exceptions / AccessDeniedException

AccessDeniedException

class Payments.Client.exceptions.AccessDeniedException

The request is denied because you don’t have sufficient access to perform this operation. Verify that you have the required permissions and try again. This error is also returned, instead of ResourceNotFoundException, when you aren’t authorized for the resource, so the response doesn’t reveal whether the resource exists.

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'reason': 'NOT_AUTHORIZED'|'INVALID_ACCOUNT_STATE'|'OTHER',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    The request is denied because you don’t have sufficient access to perform this operation. Verify that you have the required permissions and try again. This error is also returned, instead of ResourceNotFoundException, when you aren’t authorized for the resource, so the response doesn’t reveal whether the resource exists.

    • message (string) –

    • reason (string) –

      The reason that access was denied. The following values are valid:

      • NOT_AUTHORIZED – Your IAM policies don’t allow this action.

      • INVALID_ACCOUNT_STATE – Your Amazon Web Services account isn’t in a state that allows this action, for example because registration isn’t complete or the account is suspended.

      • OTHER – Access was denied for another reason.

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.