banterbot.exceptions package

banterbot.exceptions.format_mismatch_error module

exception banterbot.exceptions.format_mismatch_error.FormatMismatchError(expression: str | None = None, message: str | None = None)[source]

Bases: ValueError

Exception raised when the output format from an external API does not match the expected format. This can be used to signal a mismatch in the expected structure or content type of the data returned from an API call.

Parameters:
  • expression (Optional[str]) – The input expression or API response that caused the error. This is optional and

  • message. (used for providing context in the error)

  • message (Optional[str]) – An explanation of the error. Defaults to a standard message about format mismatch.

Raises:

FormatMismatchError – An error occurred due to a mismatch in the expected output format.