moto/moto/stepfunctions/exceptions.py

36 lines
792 B
Python
Raw Normal View History

from __future__ import unicode_literals
import json
class AWSError(Exception):
2019-09-07 16:37:55 +01:00
TYPE = None
STATUS = 400
2019-09-07 16:37:55 +01:00
def __init__(self, message, type=None, status=None):
self.message = message
2019-09-07 16:37:55 +01:00
self.type = type if type is not None else self.TYPE
self.status = status if status is not None else self.STATUS
def response(self):
2019-09-07 16:37:55 +01:00
return json.dumps({'__type': self.type, 'message': self.message}), dict(status=self.status)
2019-09-04 15:42:42 +01:00
class ExecutionDoesNotExist(AWSError):
2019-09-07 16:37:55 +01:00
TYPE = 'ExecutionDoesNotExist'
2019-09-04 15:42:42 +01:00
STATUS = 400
class InvalidArn(AWSError):
2019-09-07 16:37:55 +01:00
TYPE = 'InvalidArn'
STATUS = 400
class InvalidName(AWSError):
2019-09-07 16:37:55 +01:00
TYPE = 'InvalidName'
STATUS = 400
class StateMachineDoesNotExist(AWSError):
2019-09-07 16:37:55 +01:00
TYPE = 'StateMachineDoesNotExist'
STATUS = 400