-
-
Notifications
You must be signed in to change notification settings - Fork 486
Show error dialog box on invalid global_config.json #1425
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
Conversation
Fixes zulip#1404. Co-authored-by: sammamama <[email protected]>
Otherwise, the error will keep showing multiple times ultimately leading to a non-working app after multiple errors.
|
Would it make sense to show the actual JSON parser error message? Having a line number in the file to look at can help folks a lot. We could probably cut some of the text if we added that. |
|
I set global_config.json to just be The message is not really useful, the stacktrace I get is the following. which I think makes things more confusing. Might be better to just stick with the current generic message? |
|
Yeah, this seems fine given that, merged, thanks @shubham-padia! |
| @@ -1,8 +1,10 @@ | |||
| import {app} from "electron/main"; | |||
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.
This does not work. We’re in app/common here, which is used from both the main process and the renderer process. We’re not allowed to use main process APIs. In practice, we get app === undefined in the renderer process.
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.
Would #1430 be the right approach for rectifying this?
Fixes #1404.
Supersedes #1405. Since the content of the commit was very similar, I have added @sammamama as a co author.
I wasn't sure about quitting the app after the error so kept it as a separate commit if we want to skip it.
Screenshots and screen captures:

Platforms this PR was tested on:
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: