1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 08:16:36 +00:00

Print error stack if available

This commit is contained in:
Alexander Neumann 2016-08-21 18:07:13 +02:00
parent 72aa6be38d
commit d3f4c816c7

View file

@ -8,6 +8,7 @@ import (
"runtime"
"github.com/jessevdk/go-flags"
"github.com/pkg/errors"
)
func init() {
@ -37,10 +38,11 @@ func main() {
}
if err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
debug.Log("main", "command returned error: %#v", err)
fmt.Fprintf(os.Stderr, "%+v\n", err)
}
if restic.IsAlreadyLocked(err) {
if restic.IsAlreadyLocked(errors.Cause(err)) {
fmt.Fprintf(os.Stderr, "\nthe `unlock` command can be used to remove stale locks\n")
}