bedrock.exceptions.object_validation_exception
1from .bedrock_exception import BedrockException 2 3 4class ObjectValidationException(BedrockException): # pragma: unit 5 """ 6 Throw this exception when the client has sent a request that doesn't pass validation (e.g. a body with nulls for 7 fields that are not nullable). 8 9 Default HTTP code: 400. 10 """ 11 invalid_items = [] 12 13 def __init__(self, cls, invalid_items): 14 self.invalid_items = invalid_items 15 invalid_items_as_string = ", ".join(invalid_items) 16 super().__init__(f"Invalid {cls.__name__} items: {invalid_items_as_string}", error_code=400)
5class ObjectValidationException(BedrockException): # pragma: unit 6 """ 7 Throw this exception when the client has sent a request that doesn't pass validation (e.g. a body with nulls for 8 fields that are not nullable). 9 10 Default HTTP code: 400. 11 """ 12 invalid_items = [] 13 14 def __init__(self, cls, invalid_items): 15 self.invalid_items = invalid_items 16 invalid_items_as_string = ", ".join(invalid_items) 17 super().__init__(f"Invalid {cls.__name__} items: {invalid_items_as_string}", error_code=400)
Throw this exception when the client has sent a request that doesn't pass validation (e.g. a body with nulls for fields that are not nullable).
Default HTTP code: 400.