You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happens here is that the <c-o> handler tries to throw the error "Feature not available for users using GPG", but nobody catches it, and so it bubbles up all the way into gocui, which panics seeing the error.
Which means that there are two potential solutions to this bug:
Make it actually work
Make it show the error message that the command is not supported, without crashing
The first of these is tricky and requires more work (see here; I'm not really sure I understand that comment though...).
The second is much easier, all it takes is a call to c.Error(err) at the appropriate point in the call chain. A good place might be in MenuController.press(). However, an even better fix would be to do #3491, this would solve it once and for all everywhere.
- **PR Description**
Simplify and canonicalize error handling across the code base.
Previously it was important to make sure that errors don't bubble up
into gocui, because it would panic there; so we had to show errors in
error panels in the right places (in controller code, usually). This is
error-prone because it's easy to forget (see #3490 for an example);
also, it's not always obvious where in the call chain the error panel
needs to be shown. Most of the time it's in controller code, but we had
plenty of calls to `Error()` in helpers, and I remember that I found
this very confusing when I was new to the code base.
Change this so that you can simply return errors everywhere. The
functions to show an error message manually have been removed for
clarity.
I tried to structure the commits so that you can review them one by one.
Closes#3491.
Describe the bug
A clear and concise description of what the bug is.
When editing a GPG signed commit, and doing C-o e to Open in Editor lazygit crash
To Reproduce
Steps to reproduce the behavior:
Expected behavior
not crashing
Screenshots
If applicable, add screenshots to help explain your problem.
Version info:
commit=, build date=, build source=homebrew, version=0.41.0, os=darwin, arch=arm64, git version=2.44.0
Additional context
Add any other context about the problem here.
Note: please try updating to the latest version or manually building the latest
master
to see if the issue still occurs.The text was updated successfully, but these errors were encountered: