wrap

fun wrap(throwable: Throwable, type: KClass<out Error>? = null): Error

Wrap a caught throwable in a JavaScript error; if no error type is specified, a ValueError will be raised.

Return

Constructed JS exception type.

Parameters

throwable

Caught error to wrap.