Files
awx/awxkit/awxkit/exceptions.py
T
Liam Allen 405c56e2bc AAP-78319 Fix path traversal in awxkit YAML (#16608)
* Fix path traversal in awxkit YAML

* coderabbitai feedback
2026-08-20 12:18:32 +01:00

96 lines
1.4 KiB
Python

class Common(Exception):
def __init__(self, status_string='', message=''):
if isinstance(status_string, Exception):
self.status_string = ''
self.msg = message
super().__init__(*status_string.args)
else:
self.status_string = status_string
self.msg = message
super().__init__(status_string, message)
def __getitem__(self, val):
return (self.status_string, self.msg)[val]
def __repr__(self):
return self.__str__()
def __str__(self):
return '{} - {}'.format(self.status_string, self.msg)
class BadRequest(Common):
pass
class Conflict(Common):
pass
class Duplicate(Common):
pass
class Forbidden(Common):
pass
class InternalServerError(Common):
pass
class BadGateway(Common):
pass
class LicenseExceeded(Common):
pass
class LicenseInvalid(Common):
pass
class MethodNotAllowed(Common):
pass
class NoContent(Common):
message = ''
class NotFound(Common):
pass
class PaymentRequired(Common):
pass
class Unauthorized(Common):
pass
class Unknown(Common):
pass
class WaitUntilTimeout(Common):
pass
class UnexpectedAWXState(Common):
pass
class IsMigrating(Common):
pass
class ImportExportError(Exception):
pass
class PathTraversalError(Exception):
pass