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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for gearyov_drf_error_formatter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d2ce8c083ad5ce0e5b2ead48b1ced7a6b608ff015255f5973a5dbeb452a865fc
MD5 d87d7628eac0273fe388a27ed0fd9aac
BLAKE2b-256 def7dca870328949820566f90d571619bafa1a7e5938d1ece3106bf17475ba1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gearyov_drf_error_formatter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15d8268d1dccbf9b6b07b3bdf536bc9ce352ac4d90eeded8163aae53124f8537
MD5 8a7e84d35f3fd1a1c5e52bb4b8623834
BLAKE2b-256 e931a84acfbda20fc99c842ed754ab3dbab7657c64d7c81213995e06fbf54b81

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