mirror of
https://github.com/restic/restic.git
synced 2024-12-24 00:37:28 +00:00
Print error stack if available
This commit is contained in:
parent
72aa6be38d
commit
d3f4c816c7
1 changed files with 4 additions and 2 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/jessevdk/go-flags"
|
"github.com/jessevdk/go-flags"
|
||||||
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -37,10 +38,11 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
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")
|
fmt.Fprintf(os.Stderr, "\nthe `unlock` command can be used to remove stale locks\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue