Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/drive-integration/src/hooks/useWorkflowAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const FAILURE_REASON_MESSAGES: Partial<Record<WorkflowFailureReason, string>> =
[WorkflowFailureReason.DOCUMENT_TOO_COMPLEX]: ERROR_MESSAGES.DOCUMENT_TOO_COMPLEX,
[WorkflowFailureReason.PROCESSING_TIMEOUT]: ERROR_MESSAGES.PROCESSING_TIMEOUT,
[WorkflowFailureReason.OUT_OF_DOMAIN]: ERROR_MESSAGES.OUT_OF_DOMAIN,
[WorkflowFailureReason.MISSING_PARAMETER]: ERROR_MESSAGES.MISSING_PARAMETER,
};

const getWorkflowFailureMessage = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,18 @@ export const ModalOrchestrator = forwardRef<ModalOrchestratorHandle, ModalOrches
return;
}

if (
error instanceof WorkflowRunError &&
error.reason === WorkflowFailureReason.MISSING_PARAMETER
) {
setPreviewErrorState({
reason: WorkflowFailureReason.MISSING_PARAMETER,
title: 'Missing parameter',
message: ERROR_MESSAGES.MISSING_PARAMETER,
});
return;
}

setPreviewErrorState({
reason: WorkflowFailureReason.GENERIC,
title: 'Unable to generate preview',
Expand Down
1 change: 1 addition & 0 deletions apps/drive-integration/src/types/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export enum WorkflowFailureReason {
DOCUMENT_TOO_COMPLEX = 'document-too-complex',
PROCESSING_TIMEOUT = 'processing-timeout',
OUT_OF_DOMAIN = 'out-of-domain',
MISSING_PARAMETER = 'missing-parameter',
}

export interface WorkflowFailure {
Expand Down
2 changes: 2 additions & 0 deletions apps/drive-integration/src/utils/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const ERROR_MESSAGES = {
'The import took too long to complete. Try a simpler document or split it into smaller sections.',
OUT_OF_DOMAIN:
'This document or content type combination is outside the supported range for import. Try a different document or content type.',
MISSING_PARAMETER:
'The import could not be completed due to a missing or invalid parameter. Please try again or contact support if the issue persists.',
} as const;

export const SUCCESS_MESSAGES = {
Expand Down
Loading