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.14.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.14-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: keble_exceptions-0.0.14.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/23.3.0

File hashes

Hashes for keble_exceptions-0.0.14.tar.gz
Algorithm Hash digest
SHA256 fcb4c36b883a4a105e713a7f8df49a0327eb112bbf041d82a8de337421abe726
MD5 0b798b5b3fe8a340351b877c32b694eb
BLAKE2b-256 038141c02e0086a575f810cafb510e8b7dbe4b03e3de2bb9a71e623c412e1751

See more details on using hashes here.

File details

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

File metadata

  • Download URL: keble_exceptions-0.0.14-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/23.3.0

File hashes

Hashes for keble_exceptions-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 63271e013b4a1335bac8884c7f6f2e7372c6ee9cb6b777bfc73f80d73e335ec9
MD5 5f2bada606e9bc42073f8fb35cb34f36
BLAKE2b-256 28afc4fde29dae0eaf5b704dab38f60ece7e2fa3461fd20b7a2a8cfbfe430214

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