bedrock.exceptions.bedrock_exception
1import traceback 2 3 4class BedrockException(Exception): # pragma: unit 5 """ 6 A generic exception that can be thrown to return a user-friendly error to the client. 7 8 Default HTTP code: 500. 9 """ 10 def __init__(self, message, original_exception=None, error_code=500): 11 self.message = message 12 self.error_code = error_code 13 if original_exception is None: 14 self.original_exception = traceback.format_exc() 15 else: 16 self.original_exception = original_exception 17 super().__init__(self.message)
class
BedrockException(builtins.Exception):
5class BedrockException(Exception): # pragma: unit 6 """ 7 A generic exception that can be thrown to return a user-friendly error to the client. 8 9 Default HTTP code: 500. 10 """ 11 def __init__(self, message, original_exception=None, error_code=500): 12 self.message = message 13 self.error_code = error_code 14 if original_exception is None: 15 self.original_exception = traceback.format_exc() 16 else: 17 self.original_exception = original_exception 18 super().__init__(self.message)
A generic exception that can be thrown to return a user-friendly error to the client.
Default HTTP code: 500.
BedrockException(message, original_exception=None, error_code=500)
11 def __init__(self, message, original_exception=None, error_code=500): 12 self.message = message 13 self.error_code = error_code 14 if original_exception is None: 15 self.original_exception = traceback.format_exc() 16 else: 17 self.original_exception = original_exception 18 super().__init__(self.message)