Throughout the codebase there are many // TODOs that call for a more specific errors to be returned where possible.
In general these can be replaced by using common.handleDetailedError(). The criteria to find these and implement them properly would be:
The Server Status Object is built manually when passed as the third argument to handleError()
Above it there is already a detailed error message being logged that can be used instead
The error message being logged above doesn't include any details of the user initiating the action, or about the database structure.
The common pattern would be:
logger.generic(3, "Detailed error message only being output to logs.");
await common.handleError(req, res, {
ok: false,
short: "Server Error",
content: "Package Name is banned",
});
Which could then be made into:
await common.handleDetailedError(req, res, {
ok: false,
short: "Server Error",
content: "Detailed error message only being output to logs",
});
Throughout the codebase there are many
// TODO
s that call for a more specific errors to be returned where possible.In general these can be replaced by using
common.handleDetailedError()
. The criteria to find these and implement them properly would be:handleError()
The common pattern would be:
Which could then be made into: