Skip to main content

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

gearyov_drf_error_formatter-0.1.2.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

gearyov_drf_error_formatter-0.1.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file gearyov_drf_error_formatter-0.1.2.tar.gz.

File metadata

File hashes

Hashes for gearyov_drf_error_formatter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 645b3e821461f47d8cd8c812bc3c4dd183b201d60d3b9521879abf250c0b4d86
MD5 4fb66eccc17f07fa2903f07530399fd3
BLAKE2b-256 1aa5a79ca0558197259eb56663b12211fd6cedf67f02de9fc7de678a1a376b10

See more details on using hashes here.

File details

Details for the file gearyov_drf_error_formatter-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gearyov_drf_error_formatter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e291ddd2ad287bd6e3203ea17030312d7dd643333201eb3aedbd395b15a565e2
MD5 0931718b2980f2d27df6573804688e2e
BLAKE2b-256 459fcc9c8cf5a9ae8be392c3131e66649a3322084ca0dcf1e7c1023ff12adf50

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