#83 ✓resolved
lindsay.kay (at xeolabs)

Exceptions traceable at console

Reported by lindsay.kay (at xeolabs) | May 20th, 2010 @ 07:20 AM | in V0.7.5

Problem

In V0.7.4 if you don't register a listener to catch errors, then your fatal SceneJS errors will appear in the console as "[object, object]", which is a SceneJS exception instance. Futhermore, exceptions were being thrown from within SceneJS's error handler, not from the actual place where the exception occurred.

Solution

Have the handler return the exception message, for the caller to then throw as an exception:

...
    if (!params.uri) {
       throw SceneJS_errorModule.fatalError(new SceneJS.NodeConfigExpectedException("SceneJS.Load parameter expected: uri"));   
    }
...

To be able to tie the exception back to information in documentation, prefix the exception message with the SceneJS exception class name:

SceneJS.InvalidNodeConfigException = function(msg, cause) {
    this.message="SceneJS.InvalidNodeConfigException: " + msg ;
    this.cause = cause;
};

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.

Shared Ticket Bins

People watching this ticket

Pages