Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/proc/mod.ts>ErrorHandler

A better way to work with processes in Deno.
Latest
type alias ErrorHandler
import { type ErrorHandler } from "https://deno.land/x/proc@0.22.1/mod.ts";

Optionally change or suppress the error before it is thrown. Note that this will only be called if either one or both of error and stderrData is defined (non-null).

This is a chance to throw a custom error or to suppress throwing an error. You can pass any type of data from the stderr handler to the error handler since you own both functions.

Throw the error you want to be thrown from the process. If you want to suppress the error, just don't throw an error and return normally. It is good practice to set the error cause when wrapping a thrown error.

definition: (error?: Error, stderrData?: S) => void