Skip to content

Error Handling

Zach Radloff edited this page Oct 16, 2026 · 1 revision

Errors are always returned or provided as a value rather than throwing. This forces you into handling all error paths rather than ignoring errors or missing them. The error type is accessible from the type member.

const error = new Failure({
  message: "error message",
  type: "send-failure",
});

if (error.type === "send-failure") {
  // handle error.
  return;
}

Clone this wiki locally