Provide access to internal exception when throwing a new exception
SoundSprite for instance, does a catch and then throw new StateError(...)
Create a WrappedStateError or something that can store the error (and stack?) of the catch error – would make debugging MUCH easier
I have started to work on a better error handling, you can take a look at it here: https://github.com/bp74/StageXL/commit/1a8784ebedddb8f552f66377ff9f59c30e92fc04
The problem is that i can't figure out how to get the correct error that occurred while loading (like the 404 message). All i get is a "MediaError" which isn't derived from "Error" (seems wrong). And this error only contains a field "code" (which is not 404 for example). It seems that it's not possible to get a good error message from the browser :( At least no information is lost and the user get's much better error now, i will do this for images and videos as well.
I think this looks good. Only suggestion: consider adding a field to store the stack, too – if you can.
Also can help with debugging.
Overall, great help!
...I uncovered this with some DDC type checks failing at runtime. I've also asked the DDC team to make this easier to debug. See https://github.com/dart-lang/sdk/issues/27645
Wow, i never realized that the stack trace is not part of the error object :) I see that you can get the stack trace as second parameter in the catch block. I will add this asap! Thanks for your help on this issue.
I'm SOOO close to getting PPW working with the dev compiler. Just helping along the community. 😄
That's awesome! Never heard of anybody trying the DDC with StageXL!
This gets you over the hump – at least for pop, pop, win