0.1.0 • Published 9 years ago
dmx-error-handler-poc v0.1.0
dmx-error-handler-poc
Custom Error Handler for Microservices
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 |
Installation
npm install
npm start- Navigate to http://localhost:3000 to begin seeing custom error messages
Watchlist Setup
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 DealerField Description
| Endpoint | Status Code | Custom Message |
|---|---|---|
| /dealer | 304 | Dealer Account Not Updated |
| /dealer | 400 | Dealer ID is missing |
| /dealer | 401 | Unauthorized Dealer |
Todos:
- Modularize the error handler
- Create automated unit tests
- Support endpoints with wildcards
0.1.0
9 years ago