import { toErrorEvent } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/error/index.js";
Creates an ErrorEvent
instance based on the given error.
Examples
Example 1
Example 1
import { toErrorEvent } from "@ayonli/jsext/error";
const err = new Error("Something went wrong.");
const event = toErrorEvent(err);
console.log(event);
// ErrorEvent {
// error: Error: Something went wrong.
// at <anonymous>:1:13,
// message: "Something went wrong.",
// filename: "",
// lineno: 1,
// colno: 13
// }