Skip to content

howaboutudance/actix-json-error-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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