Added sentry logging

This commit is contained in:
Koper
2023-08-31 20:02:04 +07:00
parent 11bd568a6b
commit 7662d54c14
4 changed files with 47 additions and 9 deletions

View 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;