Skip to content

Commit

Permalink
fix: use temporal's assertNever instead of a custom one
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Oct 30, 2024
1 parent 8cc5ab7 commit a0ddcaa
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions connectors/src/connectors/zendesk/temporal/workflows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ModelId } from "@dust-tt/types";
import { assertNever } from "@temporalio/common/lib/type-helpers";
import {
executeChild,
proxyActivities,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -85,7 +78,7 @@ export async function zendeskSyncWorkflow({
break;
}
default:
assertNever(signal.type);
assertNever("Unknown signal type.", signal.type);
}
});
});
Expand Down

0 comments on commit a0ddcaa

Please sign in to comment.