2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 14:56:29 +00:00

test helpers: Always print stack trace

This commit is contained in:
Alexander Neumann 2016-09-25 18:27:03 +02:00
parent eeec0d63c2
commit 0a752b9fab
2 changed files with 3 additions and 3 deletions

View File

@ -27,9 +27,9 @@ func IsFatal(err error) bool {
return ok && e.Fatal() return ok && e.Fatal()
} }
// Fatal returns an error which implements the Fataler interface. // Fatal returns a wrapped error which implements the Fataler interface.
func Fatal(s string) error { func Fatal(s string) error {
return fatalError(s) return Wrap(fatalError(s), "Fatal")
} }
// Fatalf returns an error which implements the Fataler interface. // Fatalf returns an error which implements the Fataler interface.

View File

@ -41,7 +41,7 @@ func OKs(tb testing.TB, errs []error) {
if err != nil { if err != nil {
errFound = true errFound = true
_, file, line, _ := runtime.Caller(1) _, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error()) fmt.Printf("\033[31m%s:%d: unexpected error: %+v\033[39m\n\n", filepath.Base(file), line, err.Error())
} }
} }
if errFound { if errFound {