mirror of
https://github.com/rclone/rclone.git
synced 2025-03-14 08:25:15 +08:00
webdav: show all available information when printing errors
This commit is contained in:
parent
f1ffe8e309
commit
63f413f477
@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -109,16 +110,20 @@ type Error struct {
|
|||||||
|
|
||||||
// Error returns a string for the error and statistifes the error interface
|
// Error returns a string for the error and statistifes the error interface
|
||||||
func (e *Error) Error() string {
|
func (e *Error) Error() string {
|
||||||
|
var out []string
|
||||||
if e.Message != "" {
|
if e.Message != "" {
|
||||||
return e.Message
|
out = append(out, e.Message)
|
||||||
}
|
}
|
||||||
if e.Exception != "" {
|
if e.Exception != "" {
|
||||||
return e.Exception
|
out = append(out, e.Exception)
|
||||||
}
|
}
|
||||||
if e.Status != "" {
|
if e.Status != "" {
|
||||||
return e.Status
|
out = append(out, e.Status)
|
||||||
}
|
}
|
||||||
return "Webdav Error"
|
if len(out) == 0 {
|
||||||
|
return "Webdav Error"
|
||||||
|
}
|
||||||
|
return strings.Join(out, ": ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Time represents represents date and time information for the
|
// Time represents represents date and time information for the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user