create

open override fun create(error: Throwable): ValueError

Interface: Create from Throwable

Create a JavaScript-environment error of type T (an AbstractJsException) which wraps the provided Throwable. Any non-private fields and information on the provided Throwable will be included with the JS error.

Return

JS error instance T.

Parameters

error

Error to wrap in a JS error.


open override fun create(message: String, cause: Throwable?): ValueError

Interface: Create from and message and optional cause

Create a JavaScript-environment error of type T (an AbstractJsException) which wraps the provided message string and optional Throwable. Any non-private fields and information on the provided Throwable, if present, will be included with the JS error.

Return

JS error instance T.

Parameters

message

Error message to include.

cause

Error cause, if applicable/known. Optional; defaults to null.