-
-
Notifications
You must be signed in to change notification settings - Fork 59
[typing] Better typing in main.ts #2911
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
Catch potential error in `writeBaseSettings`
packages/controller/src/main.ts
Outdated
| } catch { | ||
| error = `Cannot write file ${configFile}`; | ||
| } | ||
| } else { |
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 now overrides the error from "L2872" ... is this intended?
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.
Changed
packages/controller/src/main.ts
Outdated
| error = `Cannot write file ${configFile}`; | ||
| } | ||
| } else if (!error) { | ||
| error = `Invalid data for writeBaseSettings ${msg.from}`; |
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.
Hm if we don't have an error yet we will always assign one here.. and the invalid data logged is the msg.from attribute? I think something is wrong here
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.
Hm okay the logic is okay as it only happens if config is falsy but shouldn't we log the received config then
Catch potential error in
writeBaseSettingsTyping for writeBaseSettings/readbaseSettings added