-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
What I'm trying to achieve
We use err from neverthrow sometimes in our app, this can be confused with err in error handler.
import {err} from "neverthrow";
// ...
return err(new Error("Test"));
// ...
logger.info("Error!", {err}); // -> err is not defined, so we will use neverthrow functionvs
// ...
try {
throw new Error("test");
} catch (err) {
logger.info("Oh no!", {err}); // -> this works fine
}
Describe a proposed solution
- Detect if function is passed to logger, if so raise warning
- Detect if error was passed e.g. without obfuscating potential PII (e.g. stacktrace) (maybe we shouldn't allow Error instances at all? keep in mind we also use modern-error)
Other solutions I've tried and won't work
Remembering about it every time :)
Screenshots or mockups
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels