Exception - acadet/ludivine GitHub Wiki

Exceptions are derived from original JS Errors and allow you to create your custom errors.

Example

class CustomException extends Exception {
    constructor(msg : string) {
        super(msg, 'CustomException');
    }
}

References

Constructors

Exception(msg : string, name : string)

Builds new exception with provided message and name.

Parameters

msg Desired message

name Desired name

Exception(msg : string)

Builds new exception with provided message. Name is set to Exception by default.

Parameters

msg Desired message


Methods

getMessage() : string;

Gets inner message.

getName() : string;

Gets name of exception.

getStackTrace() : string;

Gets stack trace.

toString() : string;

Stringifies error.