ValueError

open class ValueError : Error, AbstractJsException, ProxyObject

JavaScript: ValueError

This type implements the API surface of a ValueError exception raised within the context of an executing JavaScript guest. ValueError instances are typically raised when a value is passed to a function or operation that is not valid or legal, although the type of the value is legal.

An example of a ValueError would be the port property on a elide.runtime.intrinsics.js.URL object: if a value is provided which is a valid Int, but outside the range of valid port numbers (1-65535), a ValueError is raised instead of a TypeError.

 

Further reading

For more information about the expected behavior and API surface of a ValueError, see the following resources:

See also

for the host base interface type of all JavaScript exceptions.

for the top-most guest-exposed base class for all JavaScript errors.

Inheritors

Constructors

Link copied to clipboard
constructor(value: Value?)
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Public factory for ValueError types. Java-style exceptions can be wrapped using the create method, or a string message and cause can be provided, a-la Java exceptions.

Properties

Link copied to clipboard
open override val cause: Error? = null

Causing Error which this error wraps, if any.

Link copied to clipboard
open val columnNumber: Int?

Column number where the error was thrown, if any or if known.

Link copied to clipboard
open val errno: Int?

Error number assigned to this error (also known as the error code).

Link copied to clipboard
open val fileName: String?

File name where the error was thrown, if any or if known.

Link copied to clipboard
open val lineNumber: Int?

Line number where the error was thrown, if any or if known.

Link copied to clipboard
open override val message: String

String message associated with this error, associated at construction time.

Link copied to clipboard
open override val name: String

Name of the cause or type of this error, if any.

Link copied to clipboard

Stack trace for this error.

Functions

Link copied to clipboard
open override fun getMember(key: String?): Any?
Link copied to clipboard
open override fun getMemberKeys(): Array<String>
Link copied to clipboard
open override fun hasMember(key: String?): Boolean
Link copied to clipboard
open override fun putMember(key: String?, value: Value?)
Link copied to clipboard
open override fun removeMember(key: String?): Boolean