Skip to main content

Error handling

When an error is thrown during the execution of an action, Interval will catch it and display an "error" completion state to the person running your action.

In practice, this means you can safely throw errors inside your action code without writing additional try/catch blocks.

By example, the following code:

import Interval from "@interval/sdk";

new Interval({
apiKey: "<YOUR API KEY>", // get an API key at
actions: {
error_example: async () => {
throw new Error("Something went wrong!");

Would cause this message to be displayed to the person running your action:

Was this section useful?