You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TODO added to line 116 of requestBetaAccess function in middelware/access.ts
TODO: Add server-side logging for errors; Expand ExpressError to include a log method to log errors from catch blocks to a file.
eslint-disable-next-line @typescript-eslint/no-unused-vars
ESLint disable comment used to allow err caught in catch block to not be used. The catch block simply passes an ExpressError to the error handler without using the runtime error stored in err.
This suggests that ExpressError can be expanded to include a logging feature as described in the TODO.
The text was updated successfully, but these errors were encountered:
We might also want to consider having more elaborate typing for errors going forward, instead of having ExpressError as the catch-all. It increases complexity, but also lets you handle them more precisely. We also should take a look at the JS logging libraries out there and try integrating them rather than settling on console.log.
hiyaryan
changed the title
Add server side logging to ExpressError.
Add server side logging to ExpressError and new Error types.
Nov 8, 2024
Note that the new services layer is printing errors to the console with console.error. This makes the output in the console very verbose.
Instead of logging the error to the console, the error should be logged in a file and timestamped. The morgan error should also be timestamped. Then whenever a server side error code ≥ 500 occurs, for example, the morgan error can be traced to the error in the log.
Note that morgan middleware does not have to be used if another logger is preferred for HTTP request/response logging.
TODO added to line 116 of
requestBetaAccess
function in middelware/access.tsTODO: Add server-side logging for errors; Expand ExpressError to include a
log
method to log errors from catch blocks to a file.eslint-disable-next-line @typescript-eslint/no-unused-vars
ESLint disable comment used to allow
err
caught in catch block to not be used. The catch block simply passes anExpressError
to the error handler without using the runtime error stored inerr
.This suggests that ExpressError can be expanded to include a logging feature as described in the TODO.
The text was updated successfully, but these errors were encountered: