-
Notifications
You must be signed in to change notification settings - Fork 237
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
Do not swallow errors from session-data-defaults.js #1050
Conversation
thanks! Would you mind pasting a sample terminal output when there's an error? |
@joelanman Sure, it's a standard stack-trace, so looks like this (I threw in a random error – I gave an object a trailing comma it should not have – and I can see that it's on line 14 of session-data-defaults). Console before
Console after
|
I think this solves #793 |
Any reason not to prevent the app running? That might be more obvious that something has gone wrong. |
maybe a newline \n between the message and the error might be a small thing to help with readability |
I didn't want to change existing behaviour |
@joelanman I didn't add a newline as the two things relate to each other, whereas elsewhere in the log the new lines distinguish separate things (like the kit version and the port being used) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
in that case we just need to add a line for this in the changelog - are you ok to add that @fofr ? |
If the code generating session-data-defaults is fairly complex, spotting and fixing those errors is a common problem, and is more than fixing simple syntax issues. This change still allows the app to run, but will show the original error in the console alongside the warning about loading the defaults. By showing the full error it also highlights where there's a problem – the single line "Could not load" message can be easily missed in a busy log. Showing the error in the log allows a developer to debug and fix the problem.
766b7d8
to
5fce377
Compare
👍 @joelanman I've added a changelog entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @fofr 👍🏻
If the code generating
session-data-defaults
is fairly complex, spotting and fixing those errors is a common problem, and is more than fixing simple syntax issues.This change still allows the app to run, but will show the original error in the console alongside the warning about loading the defaults. By showing the full error it also highlights where there's a problem – the single line "Could not load…" message can be easily missed in a busy log.
Showing the error in the log allows a developer to debug and fix the problem.