Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide access to internal exception when throwing a new exception #254

Open
kevmoo opened this issue Oct 20, 2016 · 6 comments
Open

Provide access to internal exception when throwing a new exception #254

kevmoo opened this issue Oct 20, 2016 · 6 comments

Comments

@kevmoo
Copy link
Contributor

kevmoo commented Oct 20, 2016

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

@bp74
Copy link
Owner

bp74 commented Oct 22, 2016

I have started to work on a better error handling, you can take a look at it here:
1a8784e

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.

@kevmoo
Copy link
Contributor Author

kevmoo commented Oct 22, 2016

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 dart-lang/sdk#27645

@bp74
Copy link
Owner

bp74 commented Oct 22, 2016

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.

@kevmoo
Copy link
Contributor Author

kevmoo commented Oct 22, 2016

I'm SOOO close to getting PPW working with the dev compiler. Just helping along the community. 😄

@bp74
Copy link
Owner

bp74 commented Oct 22, 2016

That's awesome! Never heard of anybody trying the DDC with StageXL!

@kevmoo
Copy link
Contributor Author

kevmoo commented Oct 22, 2016

This gets you over the hump – at least for pop, pop, win

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants