Class: Error

RS.Error

The RealityServer Error class. All rejected promises will receive an instance of this class. Can be identified using either instanceof RS.Error or the name property which will be RealityServerError.

Extends from the core JavaScript Error class.

new RS.Error (message, file_name, line_number)

Creates a RealityServer error.

Name Type Description
message String optional

Human-readable description of the error.

file_name String optional

The name of the file containing the code that caused the exception.

line_number Number optional

The line number of the code that caused the exception.

Examples
try {
    await this.service.connect(url);
} catch(err) {
    if (err instanceof RS.Error) {
        // A RealityServer error
    } else {
        // some other error
    }
}
try {
    await this.service.connect(url);
} catch(err) {
    if (err.name === 'RealityServerError') {
        // A RealityServer error
    } else {
        // some other error
    }
}

Extends

  • Error