Create descriptive errors for APIs.
Currenlty supporting preconfigured messages for the following error codes:
Error Code | Default |
---|---|
200 | OK |
201 | Created |
304 | Not Modified |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
500 | Internal Server Error |
npm install
npm start
- Navigate to http://localhost:3000 to begin seeing custom error messages
The error handler currently loads custom error messages from lib/watch.list
(a CSV file) during initialization.
Sample format for Dealer retrieval:
/dealer, 304, Dealer Account Not Update
/dealer, 400, Dealer ID is missing
/dealer, 401, Unauthorized Dealer
Endpoint | Status Code | Custom Message |
---|---|---|
/dealer | 304 | Dealer Account Not Updated |
/dealer | 400 | Dealer ID is missing |
/dealer | 401 | Unauthorized Dealer |
- Modularize the error handler
- Create automated unit tests
- Support endpoints with wildcards