-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve local shell CWD setting #4396
Conversation
Signed-off-by: Sebastian Malton <[email protected]>
Signed-off-by: Sebastian Malton <[email protected]>
Signed-off-by: Sebastian Malton <[email protected]>
src/renderer/components/cluster-settings/components/cluster-local-terminal-settings.tsx
Outdated
Show resolved
Hide resolved
<p>Provided path does not exist, your changes were not saved.</p> | ||
</>, | ||
); | ||
} 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.
Shouldn't suppress unknown exceptions here. It hides information, prevents centralized error handling and logging etc.
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.
How is this suppressing unknown errors, do you mean I should handle each FS error code separately?
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.
I mean that unknown exceptions are unknown for a reason. We should treat them as fatal exceptions which have to be fixed from our side.
So basically, separate fatal exceptions and non fatal exceptions from each other.
- Fatal exception is something unexpected that we need to know about. User has no way to fix it.
- Non fatal exception is something expected that we don't need to know about. User has to fix it, since it's part of the non-happy case scenario. In this case, e.g. providing path to directory that doesn't exist is "non fatal exception", since user can simply change the directory. (as you have done)
I can see that you have done changes to the logic handling exceptions, and it's getting better. Most important part for now, is that the unknown exceptions are reported somewhere so that we can start treating them as bugs to be fixed.
In the future, I think that we should start catching the fatal exceptions from top level and using throw as a mechanism since then we have most detailed error stack available when we are trying to fix the issue. But yeah, that's long in the future, since it would mean that we need to get rid of larger scope "try/catch"-usages.
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.
We cannot really treat them as fatal since the application should continue to be usable, I would prefer "expected exceptions" vs "unexpected exceptions" (which I know sounds like an oxymoron).
In this I don't really like the design of JS, and much prefer Rust's design, where errors are just data. It is slightly hard to do that in JS since the entire ecosystem uses throw
There are no unit tests. We (me and @Iku-turso) are eager to help in making this happen :) |
Signed-off-by: Sebastian Malton <[email protected]>
@jansav I have added some basic unit tests. |
Great! |
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.
I don't see the big picture behind the improvements (e.g. why these changes are introduced?), so someone else should check it too.
Anyway, changes that I pointed out are done, so I'm happy.
I goal of this code was two fold:
|
Signed-off-by: Sebastian Malton [email protected]
Just some quality of life improvements.