A simple package for DRF errors formatting
Project description
Verbose Errors
A simple package for DRF errors formatting
Formatting
This package provides the exception handler that formats handled DRF exceptions into verbose error response
Generic error
{
"errors": [
{
"field": null,
"messages": [
"You do not have enough permissions to perform this action"
]
}
]
}
Error related to an object field
{
"errors": [
{
"field": "name",
"messages": [
"This field is required",
"This field can not be null"
]
}
]
}
Setting up
Install this package using pip
pip install djangorestframework-verbose-errors
Register the exception handler
REST_FRAMEWORK = {
'EXCEPTION_HANDLER': 'rest_framework_verbose_errors.views.exception_handler'
}
License
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
Close
Hashes for djangorestframework-verbose-errors-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fb952f70f08120087e18a2e177b445feddc5e01f07a20f88e8a0ba7c0eec1f3 |
|
MD5 | 1644995539d1860e036872289fb63e28 |
|
BLAKE2b-256 | 550e497a4767559e2c7709497b14d63a355da12495f0b27f342eb1dc3c43a21a |