Skip to main content
The Deno 2 Release Candidate is 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.30.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)