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

x/deno/cli/js/errors.ts>DenoError

A modern runtime for JavaScript and TypeScript.
Go to Latest
class DenoError
extends Error
import { DenoError } from "https://deno.land/x/deno@v0.28.0/cli/js/errors.ts";

A Deno specific error. The kind property is set to a specific error code which can be used to in application logic.

  try {
    somethingThatMightThrow();
  } catch (e) {
    if (
      e instanceof Deno.DenoError &&
      e.kind === Deno.ErrorKind.Overflow
    ) {
      console.error("Overflow error!");
    }
  }

Constructors

new
DenoError(kind: T, msg: string)