From 3205965afbd9c4fce00dc03cccd6b6223ddb1d15 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sun, 8 Dec 2019 14:17:23 -0500 Subject: Overhaul error handling for controllers This change fixes various issues with the GET endpoints to return more accurate error messages. It adds business logic error objects that are returned in a union type in the controllers. This change should help separate the business logic from the actual errors from upstream services. There may be required changes still with handling those upstream errors via Promises. Integration tests should be added to verify issues. --- src/index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 7bf2354..fdcdcaf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -43,6 +43,7 @@ new MongoClient(MONGO_URI, { useUnifiedTopology: true }).connect( app.use( expressWinston.logger({ ...logger_config("HTTP"), + colorize: true, // filter out token query param from URL msg: '{{req.method}} {{req.url.replace(/token=[-\\w.~]*(&*)/, "token=$1")}} - {{res.statusCode}} {{res.responseTime}}ms' -- cgit