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

Fail-fast mode #4

Open
domenic opened this issue Dec 11, 2012 · 2 comments
Open

Fail-fast mode #4

domenic opened this issue Dec 11, 2012 · 2 comments
Labels

Comments

@domenic
Copy link
Member

domenic commented Dec 11, 2012

Simply crash immediately upon unhandled rejections.

This would never be a default mode; if it were, the library would not be compliant with Promises/A+.

However, it might be a useful mode for debugging, especially for those systems wherein promises are not treated as first-class objects and passed around between asynchronous constructs.

This has the flaw that eventually your system will grow to use promises as first-class constructs, at which point either you'll have to turn this mode off permanently, or eliminate that use of promises and instead mangle your code to work differently.

@ForbesLindesay
Copy link
Member

I think this option is fatally flawed because you'd find libraries breaking in strange unexpected ways when using the debug mode, even if they didn't break normally.

@briancavalier
Copy link
Member

It seems like the idea here is that "fail fast" would be an option. I don't have a concrete use case, but I could imagine there are cases during development when you just want your app to fail immediately and loudly, with as much useful information as possible, so you can focus on finding that one problem.

That said, I do see the problems with it, and to me it seems better to focus on #2 initially. It's possible that a debugging tool that understands #2 could offer a "fail fast" option.

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

No branches or pull requests

3 participants