@taktikal/error-utils
v2.0.6
Published
Error utilities for Taktikal
Downloads
4
Readme
Error Utilities
Get started
Install
npm i -S @taktikal/error-utils
Server side usage
import { parseError } from "@taktikal/error-utils";
import ravenServer from "@taktikal/raven/server";
try {
// ...
} catch (e) {
const err = parseError(e, { req });
ravenServer.captureException(err.originalError, { level: "critical" });
res.status(500).send(err);
}
Client side usage
import { parseError } from "@taktikal/error-utils";
try {
// ...
} catch (e) {
const err = parseError(e);
if (err.originalError) {
ravenClient.captureException(err.originalError, { level: "critical" });
}
}