diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-19 20:12:35 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-19 20:12:35 +1100 |
commit | 6c5e409ffa5ccc76e7364971e4e0582e45dbab54 (patch) | |
tree | ae3c4519e7dab81630072dea59f6e99d15af4a1f | |
parent | 800b40ecc4ba4c144723214dfbc063d536075f1d (diff) |
send direct error message
-rw-r--r-- | pkg/gui/credentials_panel.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/credentials_panel.go b/pkg/gui/credentials_panel.go index 52ec3e405..bc894c422 100644 --- a/pkg/gui/credentials_panel.go +++ b/pkg/gui/credentials_panel.go @@ -1,7 +1,6 @@ package gui import ( - "errors" "strings" "github.com/jesseduffield/gocui" @@ -92,11 +91,12 @@ func (gui *Gui) HandleCredentialsPopup(g *gocui.Gui, popupOpened bool, cmdErr er _, _ = gui.g.SetViewOnBottom("credentials") } if cmdErr != nil { - if strings.Contains(cmdErr.Error(), "Invalid username or password") { - cmdErr = errors.New(gui.Tr.SLocalize("PassUnameWrong")) + errMessage := cmdErr.Error() + if strings.Contains(errMessage, "Invalid username or password") { + errMessage = gui.Tr.SLocalize("PassUnameWrong") } // we are not logging this error because it may contain a password - _ = gui.createSpecificErrorPanel(cmdErr.Error(), gui.getFilesView(gui.g), false) + _ = gui.createSpecificErrorPanel(errMessage, gui.getFilesView(gui.g), false) } else { _ = gui.closeConfirmationPrompt(g) _ = gui.refreshSidePanels(g) |