diff --git a/apps/dashboard/src/hooks/use-invocation-queue.ts b/apps/dashboard/src/hooks/use-invocation-queue.ts index 7d67daffc56..444bed8a088 100644 --- a/apps/dashboard/src/hooks/use-invocation-queue.ts +++ b/apps/dashboard/src/hooks/use-invocation-queue.ts @@ -1,4 +1,5 @@ import { useCallback, useRef, useState } from 'react'; +import * as Sentry from '@sentry/react'; type CallbackFunction = () => Promise; @@ -28,9 +29,7 @@ export function useInvocationQueue { + if (!invocation) return; + + try { + await invocation(); + } catch (error) { + // If the invocation fails, we want to log the error and continue with the next invocation + Sentry.captureException(error); + } + }, []); + return { enqueue, hasPendingItems,