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

Always return a Disposable from the watch() method #19321

Merged
merged 1 commit into from May 13, 2019

Conversation

Projects
None yet
2 participants
@rafeca
Copy link
Contributor

commented May 13, 2019

When there's an error watching the config file (as it happened here), we're currently swallowing the actual error and returning undefined from the watch method. This basically produces a different error in atom-application since that return value is not a disposable.

In order to fix that while maintaining what I think is the original goal of the code, this PR adds a return statement to return an empty disposable. This way the error gets propagated correctly to atom-application and it actually does not prevent Atom to get opened.

Note that this does not fix the original error reported in #19320: it just makes it easier to debug.

Alternate designs

Instead of returning an empty Disposable, we can just remove the catch block and completely fail if there's an error watching the config file. I haven't decided to do so to maintain as much as possible the intention of the original code (which was to not fail under that circumstance), but I can change that if somebody has strong opinions on it.

@rafeca rafeca requested review from nathansobo and maxbrunsfeld May 13, 2019

@nathansobo
Copy link
Contributor

left a comment

Argh. First lurking dragon of the notify changes has been uncovered. Thanks for addressing this. I'll jump on the other issue.

@rafeca rafeca merged commit a489661 into master May 13, 2019

1 of 2 checks passed

Atom Pull Requests in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@rafeca rafeca deleted the rethrow-exception branch May 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.