mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
Added sentry logging
This commit is contained in:
17
www/app/(errors)/handleError.ts
Normal file
17
www/app/(errors)/handleError.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user