Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/boto/beanstalk/exception.py @ 5:9b1c78e6ba9c draft default tip
"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
author | shellac |
---|---|
date | Mon, 01 Jun 2020 08:59:25 -0400 |
parents | 79f47841a781 |
children |
comparison
equal
deleted
inserted
replaced
4:79f47841a781 | 5:9b1c78e6ba9c |
---|---|
1 import sys | |
2 from boto.compat import json | |
3 from boto.exception import BotoServerError | |
4 | |
5 | |
6 def simple(e): | |
7 code = e.code | |
8 | |
9 if code.endswith('Exception'): | |
10 code = code.rstrip('Exception') | |
11 | |
12 try: | |
13 # Dynamically get the error class. | |
14 simple_e = getattr(sys.modules[__name__], code)(e) | |
15 except AttributeError: | |
16 # Return original exception on failure. | |
17 return e | |
18 | |
19 return simple_e | |
20 | |
21 | |
22 class SimpleException(BotoServerError): | |
23 def __init__(self, e): | |
24 super(SimpleException, self).__init__(e.status, e.reason, e.body) | |
25 self.error_message = self.message | |
26 | |
27 def __repr__(self): | |
28 return self.__class__.__name__ + ': ' + self.error_message | |
29 def __str__(self): | |
30 return self.__class__.__name__ + ': ' + self.error_message | |
31 | |
32 | |
33 class ValidationError(SimpleException): pass | |
34 | |
35 # Common beanstalk exceptions. | |
36 class IncompleteSignature(SimpleException): pass | |
37 class InternalFailure(SimpleException): pass | |
38 class InvalidAction(SimpleException): pass | |
39 class InvalidClientTokenId(SimpleException): pass | |
40 class InvalidParameterCombination(SimpleException): pass | |
41 class InvalidParameterValue(SimpleException): pass | |
42 class InvalidQueryParameter(SimpleException): pass | |
43 class MalformedQueryString(SimpleException): pass | |
44 class MissingAction(SimpleException): pass | |
45 class MissingAuthenticationToken(SimpleException): pass | |
46 class MissingParameter(SimpleException): pass | |
47 class OptInRequired(SimpleException): pass | |
48 class RequestExpired(SimpleException): pass | |
49 class ServiceUnavailable(SimpleException): pass | |
50 class Throttling(SimpleException): pass | |
51 | |
52 | |
53 # Action specific exceptions. | |
54 class TooManyApplications(SimpleException): pass | |
55 class InsufficientPrivileges(SimpleException): pass | |
56 class S3LocationNotInServiceRegion(SimpleException): pass | |
57 class TooManyApplicationVersions(SimpleException): pass | |
58 class TooManyConfigurationTemplates(SimpleException): pass | |
59 class TooManyEnvironments(SimpleException): pass | |
60 class S3SubscriptionRequired(SimpleException): pass | |
61 class TooManyBuckets(SimpleException): pass | |
62 class OperationInProgress(SimpleException): pass | |
63 class SourceBundleDeletion(SimpleException): pass |