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

@@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { DefaultApi, V1TranscriptsCreateRequest } from "../api/apis/DefaultApi";
import { GetTranscript } from "../api";
import { useError } from "../(errors)/errorContext";
import handleError from "../(errors)/handleError";
type UseTranscript = {
response: GetTranscript | null;
@@ -37,7 +38,7 @@ const useTranscript = (api: DefaultApi): UseTranscript => {
})
.catch((err) => {
const errorString = err.response || err.message || "Unknown error";
setError(errorString);
handleError(setError, errorString, err);
setLoading(false);
console.error("Error creating transcript:", errorString);
});