/actix-json-error-middleware

A actix-web middleware to respond to requests that error with JSON

Primary LanguageRustApache License 2.0Apache-2.0

actix-web JSON-formatted Error Middleware

Description

This library is an actix-web middleware that:

  • Changes the content-type header from html to application/json
  • changes the repsonses body from blank to a JSON blob that looks like:
      {"error": 404, "message": "error"}

Development Environment Setup

Currently this project only requires you to run:

cargo check

Testing The Library

All tests are unit written in src/lib.rs currently to run the tests:

cargo test

To Contribute

Please fork, edit/create a patch and submit a PR against the project repo

File a Bug

Use the issues-page of the github repo