diff --git a/connectors/src/connectors/zendesk/temporal/workflows.ts b/connectors/src/connectors/zendesk/temporal/workflows.ts index 1bff48e8f920..026313fc4e53 100644 --- a/connectors/src/connectors/zendesk/temporal/workflows.ts +++ b/connectors/src/connectors/zendesk/temporal/workflows.ts @@ -1,4 +1,5 @@ import type { ModelId } from "@dust-tt/types"; +import { assertNever } from "@temporalio/common/lib/type-helpers"; import { executeChild, proxyActivities, @@ -29,14 +30,6 @@ const { startToCloseTimeout: "1 minute", }); -function assertNever(x: never): never { - throw new Error( - `${ - typeof x === "object" ? JSON.stringify(x) : x - } is not of type never. This should never happen.` - ); -} - /** * Sync Workflow for Zendesk. * This workflow is responsible for syncing all the help centers and tickets for a given connector. @@ -85,7 +78,7 @@ export async function zendeskSyncWorkflow({ break; } default: - assertNever(signal.type); + assertNever("Unknown signal type.", signal.type); } }); });