0.1.0 • Published 7 years ago

dmx-error-handler-poc v0.1.0

Weekly downloads
1
License
UNLICENSED
Repository
-
Last release
7 years ago

dmx-error-handler-poc

Custom Error Handler for Microservices

Create descriptive errors for APIs.

Currenlty supporting preconfigured messages for the following error codes:

Error CodeDefault
200OK
201Created
304Not Modified
400Bad Request
401Unauthorized
403Forbidden
500Internal Server Error

Installation

npm install
npm start
  1. 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 Dealer

Field Description

EndpointStatus CodeCustom Message
/dealer304Dealer Account Not Updated
/dealer400Dealer ID is missing
/dealer401Unauthorized Dealer

Todos:

  • Modularize the error handler
  • Create automated unit tests
  • Support endpoints with wildcards