UNPKG

rjweb-server

Version:

Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS

16 lines (15 loc) 410 B
export default class RuntimeError { /** * Create a new Runtime Error * @since 9.0.0 */ constructor(cause, error) { this.cause = cause; this.error = error; } /** * Get the Error message * @since 9.0.0 */ toString() { return `(${this.cause})\n\n${this.error instanceof Error ? this.error.stack ?? this.error.message : String(this.error)}`; } }