Skip to main content

Custom exceptions for Django REST Framework

Project description

Custom exceptions for django rest framework

Compatibility

Works with :

  • Python 2.7, 3.4, 3.5, 3.6
  • Django >= 1.10
  • Django Rest Framework >= 3.5
https://travis-ci.org/unistra/django-rest-framework-custom-exceptions.svg?branch=master https://coveralls.io/repos/github/unistra/django-rest-framework-custom-exceptions/badge.svg?branch=master Code Health

Installation

Install the package from pypi:

pip install djangorestframework-custom-exceptions

Add the application in your django settings:

INSTALLED_APPS = ('rest_framework_custom_exceptions',)

Configure your rest framework :

REST_FRAMEWORK = {
    'EXCEPTION_HANDLER': 'rest_framework_custom_exceptions.exceptions.simple_error_handler'
}

Example

The simple error handler show exceptions like this :

{
    "error": "Not found"
}

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

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page