Skip to content

Commit

Permalink
fix: fetch exception to sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
matmut7 committed Jan 9, 2024
1 parent 5497759 commit c51080b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/rest-fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logger from "./logger"
import * as Sentry from "@sentry/nextjs"

const fetcher = async (url: string, params: Record<string, unknown>) => {
try {
Expand All @@ -9,7 +10,8 @@ const fetcher = async (url: string, params: Record<string, unknown>) => {
}
return response
} catch (error) {
logger.error("Error attempting to fetch", error)
logger.error(error, "Error attempting to fetch")
Sentry.captureException(error)
}
}

Expand Down

0 comments on commit c51080b

Please sign in to comment.