Skip to main content

No project description provided

Project description

keble-exceptions

This package provides a set of predefined exceptions for various error scenarios within the Keble codebase. These exceptions inherit from the base KebleException class.

Base KebleException Signature

def __init__(
    self,
    *,
    alert_admin: bool = False,
    function_identifier: Optional[str] = None,
    admin_note: Optional[str] = None,
    status_code: int = 400,
    how_to_resolve: Optional[HowToResolve] = None,
    fingerprint: Optional[List[str]] = None,
):
    ...

Predefined Exceptions Signatures

Authentication and Authorization Exceptions

  • TokenExpired
    def __init__(self, *args, **kwargs):
        ...
    
  • TokenPurposeUnmatched
    def __init__(self, *args, **kwargs):
        ...
    
  • InactiveUser
    def __init__(self, *args, **kwargs):
        ...
    
  • UserNotFound
    def __init__(self, *args, **kwargs):
        ...
    
  • UserIdentityVerificationIsRequired
    def __init__(self, *args, **kwargs):
        ...
    
  • UserOrOrgIdentityNoSufficientToken
    def __init__(self, *args, **kwargs):
        ...
    
  • NoObjectPermission
    def __init__(self, *, object_id: str, object_type: Optional[str] = None, *args, **kwargs):
        ...
    
  • NoRolePermission
    def __init__(self, *, current_role: str, require_role: str, *args, **kwargs):
        ...
    

Email and Registration Exceptions

  • EmailNotRegistered
    def __init__(self, *args, **kwargs):
        ...
    
  • EmailRegistered
    def __init__(self, *args, **kwargs):
        ...
    
  • InvalidEmailConfirmationCode
    def __init__(self, *args, **kwargs):
        ...
    
  • InvalidEmailOrPassword
    def __init__(self, *args, **kwargs):
        ...
    

Parameter Validation Exceptions

  • ServerSideMissingParams
    def __init__(self, *, missing_params: str, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    
  • ClientSideMissingParams
    def __init__(self, *, missing_params: str, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    
  • ServerSideInvalidParams
    def __init__(self, *, invalid_params: str | int, expected: str | int | Type, but_got: str | int | Type, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    
  • ClientSideInvalidParams
    def __init__(self, *, invalid_params: str | int, expected: str | int | Type, but_got: str | int | Type, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    

Data and Object Exceptions

  • ObjectNotFound
    def __init__(self, *, object_name: str, id: Any, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    
  • DataIntegrityCompromised
    def __init__(self, *, object_name: Optional[str] = None, id: Any = None, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    

Processing and Iteration Exceptions

  • MaxIterationReached
    def __init__(self, *, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    
  • UnhandledScenarioOrCase
    def __init__(self, *, unhandled_case: str, alert_admin: bool, admin_note: Optional[Any] = None, *args, **kwargs):
        ...
    

Request and Response Exceptions

  • RequestFailure
    def __init__(self, *, admin_note: Any, function_identifier: str, alert_admin: bool, *args, **kwargs):
        ...
    
  • LlmInvalidResponse
    def __init__(self, *, alert_admin: bool, admin_note: Optional[Any] = None, function_identifier: Optional[str] = None, *args, **kwargs):
        ...
    

Rate Limiting Exceptions

  • EmailSendingLimitReached
    def __init__(self, *, wait_minutes: str | float | int, alert_admin: bool, function_identifier: Optional[str] = None, *args, **kwargs):
        ...
    
  • SmsSendingLimitReached
    def __init__(self, *, wait_minutes: str | float | int, alert_admin: bool, function_identifier: Optional[str] = None, *args, **kwargs):
        ...
    
  • FrequencyLimitReached
    def __init__(self, *, wait_minutes: str | float | int, alert_admin: bool, function_identifier: Optional[str] = None, *args, **kwargs):
        ...
    
  • WechatBindingLimitExceeded
    def __init__(self, *, limit: int = 3, alert_admin: bool, admin_note: Any | None = None, *args, **kwargs):
        ...
    

raise_if_not Function

def raise_if_not(condition: bool | List[bool], exception: KebleException):
    # raise when condition is not TRUE or not all TRUE
    ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keble_exceptions-0.0.15.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keble_exceptions-0.0.15-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file keble_exceptions-0.0.15.tar.gz.

File metadata

  • Download URL: keble_exceptions-0.0.15.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/25.1.0

File hashes

Hashes for keble_exceptions-0.0.15.tar.gz
Algorithm Hash digest
SHA256 0f57b834d5bf8fd1c67ef9c980cca9741b26e9e9bc7f3cb630a4a71d50afb577
MD5 b31ee0fcb8397b91d85e36dc16f870cf
BLAKE2b-256 d2db4d064969d4424a351318a5059962c97038656008ae9185ed1aa3257df7cc

See more details on using hashes here.

File details

Details for the file keble_exceptions-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: keble_exceptions-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/25.1.0

File hashes

Hashes for keble_exceptions-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 20f8a604446ef3a24d539e60d70dbfb86356b3cd889351506db3a6552e4d02c8
MD5 ffafcc44ec2ed169a5701e75fba2371f
BLAKE2b-256 01b2187a7e78e6b17a57c6db9cbfa86f52228f3a60b37e0b5a8a754cda2f3e22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page