mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
termui: avoid importing a whole package to check an error
This commit is contained in:
parent
c0bf7c359f
commit
ac7e508633
1
go.mod
1
go.mod
@ -12,7 +12,6 @@ require (
|
||||
github.com/corpix/uarand v0.1.1 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0
|
||||
github.com/fatih/color v1.9.0
|
||||
github.com/go-errors/errors v1.1.1
|
||||
github.com/gorilla/mux v1.7.4
|
||||
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
||||
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428
|
||||
|
@ -7,8 +7,6 @@ import (
|
||||
"github.com/awesome-gocui/gocui"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
errors2 "github.com/go-errors/errors"
|
||||
|
||||
"github.com/MichaelMure/git-bug/cache"
|
||||
"github.com/MichaelMure/git-bug/entity"
|
||||
"github.com/MichaelMure/git-bug/input"
|
||||
@ -67,8 +65,12 @@ func Run(cache *cache.RepoCache) error {
|
||||
|
||||
err := <-ui.gError
|
||||
|
||||
type errorStack interface {
|
||||
ErrorStack() string
|
||||
}
|
||||
|
||||
if err != nil && err != gocui.ErrQuit {
|
||||
if e, ok := err.(*errors2.Error); ok {
|
||||
if e, ok := err.(errorStack); ok {
|
||||
fmt.Println(e.ErrorStack())
|
||||
}
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user