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

fix(throw on missing stats.json) #1561

Merged

Conversation

dpchamps
Copy link
Contributor

#problem

the loadAssetsFromStats function will return an empty object when stats.json cannot be found. This results in undefined behavior downstream: see the code path in #1558 as an example.
Should this fail -- whether from unexpected behavior or invalid inputs, the error delivered to the end-user is unrelated to the original failure.

#solution

Instead of preempting a file io error by returning an empty object, the function should throw with a helpful message. If consumers expect the file to be missing, the callsite should handle as necessary. Otherwise, the end-user get's an idea of what failed.

closes #1558

@CLAassistant
Copy link

CLAassistant commented Mar 13, 2020

CLA assistant check
All committers have signed the CLA.

@jchip jchip merged commit bd7f5c4 into electrode-io:master Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

subapp-web: dangerously falls back onerror when downstream code expects non-error condition
3 participants