Create general SceneJS.Exception class for standardised error events
Reported by lindsay.kay (at xeolabs) | May 11th, 2010 @ 04:25 AM | in V0.7.5
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);
});
Comments and changes to this ticket
-
lindsay.kay (at xeolabs) May 11th, 2010 @ 11:35 PM
- State changed from new to resolved
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.
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.