Files
reflector/www/app/(errors)/handleError.ts
2023-08-31 20:02:04 +07:00

18 lines
304 B
TypeScript

import * as Sentry from "@sentry/react";
const handleError = (
setError: Function,
errorString: string,
errorObj?: any,
) => {
setError(errorString);
if (errorObj) {
Sentry.captureException(errorObj);
} else {
Sentry.captureMessage(errorString);
}
};
export default handleError;