feat: Add central error handler

Added:
- Added Midleware to capture and handle all errors
    - will catch error from `throw ...` and `next(...)`
- Added RequestError base error class to build consistent error objects
- Added common errors like `UnauthorizedRequestError`, `BadRequestError`
- Added consistent Logging solution using `winston`
    - Supports Loki Transporter using `winston-loki`
- Outputing Legal disclaimer to console when `TELEMETRY_ENABLED=true`

Changed:
- Changed console.log to getLogger() favor of using consistent logging
This commit is contained in:
Hüseyin Berke Bütün
2022-12-22 00:55:41 +01:00
parent 2d3255edc0
commit bd9041a62c
12 changed files with 688 additions and 11081 deletions
+404 -11071
View File
File diff suppressed because it is too large Load Diff