diff --git a/apps/drive-integration/src/hooks/useWorkflowAgent.ts b/apps/drive-integration/src/hooks/useWorkflowAgent.ts index 1c5c51d4fc..04ce098dab 100644 --- a/apps/drive-integration/src/hooks/useWorkflowAgent.ts +++ b/apps/drive-integration/src/hooks/useWorkflowAgent.ts @@ -127,6 +127,14 @@ const getBackendWorkflowFailureReason = (runData: AgentRunData): WorkflowFailure return WorkflowFailureReason.GOOGLE_DOCS_NOT_FOUND; } + if (workflowFailure.code === WorkflowFailureReason.AI_SERVICE_UNAVAILABLE) { + return WorkflowFailureReason.AI_SERVICE_UNAVAILABLE; + } + + if (workflowFailure.code === WorkflowFailureReason.APP_NOT_INSTALLED) { + return WorkflowFailureReason.APP_NOT_INSTALLED; + } + if (workflowFailure.code === WorkflowFailureReason.GENERIC) { return WorkflowFailureReason.GENERIC; } @@ -146,6 +154,14 @@ const getWorkflowFailureMessage = ( return ERROR_MESSAGES.GOOGLE_DOCS_NOT_FOUND; } + if (failureReason === WorkflowFailureReason.AI_SERVICE_UNAVAILABLE) { + return ERROR_MESSAGES.AI_SERVICE_UNAVAILABLE; + } + + if (failureReason === WorkflowFailureReason.APP_NOT_INSTALLED) { + return ERROR_MESSAGES.APP_NOT_INSTALLED; + } + return getRunErrorMessage(runData); }; diff --git a/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx b/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx index ecfc233ba3..31e6431bee 100644 --- a/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx +++ b/apps/drive-integration/src/locations/Page/components/mainpage/ModalOrchestrator.tsx @@ -175,6 +175,30 @@ export const ModalOrchestrator = forwardRef Manage apps and try again.', } as const; export const SUCCESS_MESSAGES = {