Custom DRF exception handler that formats all exceptions into a consistent JSON payload
Project description
gearyov-drf-error-formatter
Custom DRF exception handler that formats all exceptions into a consistent JSON payload.
Features
- Uniform JSON output for both DRF-native exceptions and unhandled Python exceptions
- Client errors (4xx) preserve field-level details as flattened messages
- Server errors (5xx) return exception args and type for easier debugging
- Automatically includes exception type and originating view in the response
Installation
pip install gearyov-drf-error-formatter
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gearyov_drf_error_formatter-0.1.0.tar.gz.
File metadata
- Download URL: gearyov_drf_error_formatter-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.0 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2ce8c083ad5ce0e5b2ead48b1ced7a6b608ff015255f5973a5dbeb452a865fc
|
|
| MD5 |
d87d7628eac0273fe388a27ed0fd9aac
|
|
| BLAKE2b-256 |
def7dca870328949820566f90d571619bafa1a7e5938d1ece3106bf17475ba1e
|
File details
Details for the file gearyov_drf_error_formatter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gearyov_drf_error_formatter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.0 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15d8268d1dccbf9b6b07b3bdf536bc9ce352ac4d90eeded8163aae53124f8537
|
|
| MD5 |
8a7e84d35f3fd1a1c5e52bb4b8623834
|
|
| BLAKE2b-256 |
e931a84acfbda20fc99c842ed754ab3dbab7657c64d7c81213995e06fbf54b81
|