mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
19 lines
378 B
TypeScript
19 lines
378 B
TypeScript
import * as Sentry from "@sentry/react";
|
|
import { Dispatch, SetStateAction } from "react";
|
|
|
|
const handleError = (
|
|
setError: Dispatch<SetStateAction<String>>,
|
|
errorString: string,
|
|
errorObj?: any,
|
|
) => {
|
|
setError(errorString);
|
|
|
|
if (errorObj) {
|
|
Sentry.captureException(errorObj);
|
|
} else {
|
|
Sentry.captureMessage(errorString);
|
|
}
|
|
};
|
|
|
|
export default handleError;
|