Skip to main content

Base exception hierarchy for Python web applications

Project description

python-app-exceptions

Base exception hierarchy for Python web applications.

Installation

pip install python-app-exceptions

Usage

from python_app_exceptions import (
    BaseApplicationException,
    BusinessLogicError,
    ValidationError,
    InvalidInputError,
    RetryExhaustedException,
    RetryableError
)

# Raise validation errors
raise ValidationError("email", "invalid@", "Invalid email format")

# Raise business logic errors
raise BusinessLogicError("user_must_be_active", "User account is disabled")

# Raise retry errors
raise RetryExhaustedException("api_call", attempts=3)

Features

  • ✅ Clean exception hierarchy
  • ✅ Detailed error messages with optional details
  • ✅ Framework-agnostic (works with FastAPI, Flask, Django, etc.)
  • ✅ Type-safe
  • ✅ Zero dependencies

Exception Hierarchy

BaseApplicationException
├── BusinessLogicError
├── ValidationError
│   └── InvalidInputError
└── RetryExhaustedException
└── RetryableError

License

MIT

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

python_app_exceptions-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

python_app_exceptions-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file python_app_exceptions-0.1.0.tar.gz.

File metadata

  • Download URL: python_app_exceptions-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for python_app_exceptions-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed7b5862e7545f4fb66e617259982d245df19dd9ebc7d092602ca09344642e7d
MD5 897b62e4097a01afab04f798a2cebc35
BLAKE2b-256 d07a74b9b88895f7305996be468f44092428a9672b6427d011bb7c608130eb6e

See more details on using hashes here.

File details

Details for the file python_app_exceptions-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_app_exceptions-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dc040ba3e1a0d02603dc774d20e61f4132eb48cef804302be91a50777f0f2b3
MD5 78f90a43e9d8c6402230e4691454effb
BLAKE2b-256 3862069d108be5a0bb5f3e3a9708e2f73cf65756e2775d9142a573258f9bcd99

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