Skip to main content
Module

x/tstl/exception/Exception.ts>Exception#toJSON

TypeScript-STL (Standard Template Library, migrated from C++)
Latest
method Exception.prototype.toJSON
import { Exception } from "https://deno.land/x/tstl@v3.0.0/exception/Exception.ts";

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 const the class to export additional props (or remove some props), override this Exception.toJSON method.

Returns

object

An object for JSON.stringify().