summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers/merge_conflicts_helper.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-04-18 10:14:51 +0200
committerGitHub <noreply@github.com>2024-04-18 10:14:51 +0200
commit34f8f7293c5c901461a26f09839ebe5f0dd79869 (patch)
tree4b65b46c7d1e32f1d8e90b528545b081b0fd8822 /pkg/gui/controllers/helpers/merge_conflicts_helper.go
parent145795c0b07da129599506ac8827a16314456ac4 (diff)
parentcaad55350252793b53aaf699062644a2cddc6a08 (diff)
Simplify error handling (#3502)
- **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.
Diffstat (limited to 'pkg/gui/controllers/helpers/merge_conflicts_helper.go')
-rw-r--r--pkg/gui/controllers/helpers/merge_conflicts_helper.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/gui/controllers/helpers/merge_conflicts_helper.go b/pkg/gui/controllers/helpers/merge_conflicts_helper.go
index 31f7bd5e3..249be4b69 100644
--- a/pkg/gui/controllers/helpers/merge_conflicts_helper.go
+++ b/pkg/gui/controllers/helpers/merge_conflicts_helper.go
@@ -129,7 +129,7 @@ func (self *MergeConflictsHelper) RefreshMergeState() error {
hasConflicts, err := self.SetConflictsAndRender(self.c.Contexts().MergeConflicts.GetState().GetPath())
if err != nil {
- return self.c.Error(err)
+ return err
}
if !hasConflicts {