Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Create general SceneJS.Exception class for standardised error events

#65

Currently an "error" event observed with SceneJS.onEvent comes in two flavours - with or without the message on the exception:

SceneJS.onEvent("error", function(e) {
    if (e.exception.message) {
        alert("Error: " + e.exception.message);
    } else {
        alert("Error: " + e.exception);
    }
 });

This because the exception may or may not be a SceneJS exception object.

Solution

Create a SceneJS.Exception class and wrap non-SceneJS exceptions in it, so we can catch them like this:

SceneJS.onEvent("error", function(e) {
        alert("Error: " + e.exception.message);        
 });

Reported by lindsay.kay (at xeolabs) · May 11th, 2010 @ 04:25 AM

State: resolved
Milestone: V0.7.5

Activity

  1. lindsay.kay (at xeolabs)
    lindsay.kay (at xeolabs)
    • State changed from new to resolved

    May 11th, 2010 @ 11:35 PM

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.