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

Stop crashing when update-notifier fails #715

Merged
merged 3 commits into from
Apr 27, 2016
Merged

Conversation

LinusU
Copy link
Contributor

@LinusU LinusU commented Apr 27, 2016

related: #714

ping @rwaldron @johnnyman727

This is a quick fix that will stop the t2 cli from crashing for the affected users. It will print a warning and then report the error to our crash server.

screen shot 2016-04-27 at 23 08 50

Another funny thing I noticed is that the crash reporter won't be able to upload crash data if we call process.exit() to early, like we do when running only t2 for example, but that's another issue altogether...

try {
updateNotifier({ pkg }).notify();
} catch (err) {
logs.warn('Failed to check for newer version of the CLI');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might even be in favor of silently failing with this one because it seems like people who do have the problem will hit this virtually every time they use the CLI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in favor of silently failing with this one

Seconded

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

What we could to would be to only show the error the first time, if only there was some kind of library that made it very easy to store if we have previously shown the error or not... Oh, I know! Nah, just kidding ;)

try {
updateNotifier({ pkg }).notify();
} catch (err) {
CrashReporter.submit(err.stack);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this going to have the same net outcome?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, do you mean that it will print a warning? Yes that is right, I'll take a look...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't because the error is caught. CrashReporter.submit doesn't exit the process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It prints INFO Crash Reported: http://crash-reporter.tessel.io/crashes?fingerprint=-0x173999f5 which is about as annoying as WARN Failed to check for newer versions of the CLI

try {
updateNotifier({ pkg }).notify();
} catch (err) {
CrashReporter.submit(err.stack, { silent: true });
Copy link
Contributor

@rwaldron rwaldron Apr 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, now it's quiet for the user, but http://crash-reporter.tessel.io/ is going to continue to amass these reports. I think the real fix is to simply suppress this error :| (or maybe the authors of configstore could just make the damn thing work without barfing all over the place)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was a good idea to keep collecting the crash data, that way we can see how many users are impacted by this, and also help out with additional information that might be required for yeoman/update-notifier#76...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I can agree to that then.

@LinusU
Copy link
Contributor Author

LinusU commented Apr 27, 2016

@rwaldron I need to go to bed now but feel free to make modifications to this branch and land it 👍

@rwaldron
Copy link
Contributor

I need to go to bed now but feel free to make modifications to this branch and land it

Good night!

@rwaldron rwaldron merged commit 97b69bf into tessel:master Apr 27, 2016
@rwaldron
Copy link
Contributor

Tests added: 43db821

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.

None yet

3 participants