Skip to main content
Module

x/tstl/exception/Exception.ts>Exception

TypeScript-STL (Standard Template Library, migrated from C++)
Go to Latest
class Exception
extends Error
import { Exception } from "https://deno.land/x/tstl@v2.4.11/exception/Exception.ts";

Base Exception.

Constructors

new
Exception(message: string)

Initializer Constructor.

Properties

readonly
name: string

The error name.

Methods

toJSON(): object

Native function for JSON.stringify().

The Exception.toJSON function returns only three properties; (name, message and stack). If you want to define a new sub-class extending the Exception and let the class to export additional props (or remove some props), override this Exception.toJSON method.

what(): string

Get error message.