V8 Javascript API

RS.Error Class Reference

Description

Helper class to return errors to the user. Instantiate and throw this class to return errors. Also contains static properties representing the standard RealityServer error codes.

‎ throw new RS.Error(RS.Error.INVALID_PARAMETERS,'Required parameter has invalid value');

Constructor

 Error( Number code, String message, Any data)
More...

Properties

Number  code
The error code.
Any  data
Additional error data.
String  message
The error message.

Error codes

Number  COMMAND_INVALID_PARAMS
Invalid arguments to command.
Number  COMMAND_NEURAY_ERROR
Internal neuray error while executing command.
Number  COMMAND_NOT_FOUND
Requested command is unknown.
Number  COMMAND_PERMISSION_DENIED
User does not have permission to execute the given command.
Number  EVENT_HANDLER_NAME_INVALID
No event handler with this name has been registered.
Number  EVENT_NO_HANDLERS
No event handlers have been registered for this event type.
Number  FAILED
General failure.
Number  INVALID_OPERATION
The requested operation is invalid for the current state.
Number  INVALID_PARAMETERS
A passed parameter was invalid.
Number  MEMORY
Insufficient memory.
Number  NEURAY
The neuray library reported an error state.
Number  NONE
No error.
Number  NOT_FOUND
Not found.

Constructor

RS.​Error( Number code, String message, Any data)

Parameters

code
the error code to return.
message
the error message to return.
data
additional data to return, optional.

Properties

Number RS.​Error.COMMAND_INVALID_PARAMS [static]

Invalid arguments to command.

Number RS.​Error.COMMAND_NEURAY_ERROR [static]

Internal neuray error while executing command.

Number RS.​Error.COMMAND_NOT_FOUND [static]

Requested command is unknown.

Number RS.​Error.COMMAND_PERMISSION_DENIED [static]

User does not have permission to execute the given command.

Number RS.​Error.EVENT_HANDLER_NAME_INVALID [static]

No event handler with this name has been registered.

Number RS.​Error.EVENT_NO_HANDLERS [static]

No event handlers have been registered for this event type.

Number RS.​Error.FAILED [static]

General failure.

Number RS.​Error.INVALID_OPERATION [static]

The requested operation is invalid for the current state.

Number RS.​Error.INVALID_PARAMETERS [static]

A passed parameter was invalid.

Number RS.​Error.MEMORY [static]

Insufficient memory.

Number RS.​Error.NEURAY [static]

The neuray library reported an error state.

Number RS.​Error.NONE [static]

No error.

Number RS.​Error.NOT_FOUND [static]

Not found.

Number RS.​Error.code

The error code.

Any RS.​Error.data

Additional error data.

String RS.​Error.message

The error message.