1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

use go-errors package to display stacktrace of errors that cause panics

This commit is contained in:
Jesse Duffield
2019-02-11 21:30:27 +11:00
parent 3a607061a2
commit cfe3605e6b
13 changed files with 55 additions and 37 deletions

View File

@ -6,7 +6,6 @@ import (
// "io"
// "io/ioutil"
"errors"
"io/ioutil"
"log"
"os"
@ -14,6 +13,8 @@ import (
"strings"
"time"
"github.com/go-errors/errors"
// "strings"
"github.com/fatih/color"
@ -568,7 +569,9 @@ func (gui *Gui) RunWithSubprocesses() {
gui.SubProcess.Stdin = nil
gui.SubProcess = nil
} else {
log.Panicln(err)
newErr := errors.Wrap(err, 0)
stackTrace := newErr.ErrorStack()
log.Panicln(stackTrace)
}
}
}