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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for gearyov_drf_error_formatter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 853dda6615bab1056d96330367eeb06458f808f4496150e45667cfda9cc12d10
MD5 cccaea4252d10ddc64fbbf00564cad9d
BLAKE2b-256 b36957efaaab272c9bf00563c97bed6531dd7637abf89618962a63240fdd1179

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gearyov_drf_error_formatter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 809109278b2c4eb76b9555cb78b73464f7aafc8e2860ee33ec1b962d984d021a
MD5 483639f368d7c75b9cd36991af2c9f06
BLAKE2b-256 810d8f3e9c34d2106e68f9c14d9fd5a04aafb4e4c7df88aeba95a08cbe5259e4

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