forked from aliyun/ossutil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.go
54 lines (43 loc) · 1.06 KB
/
error.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package lib
import (
"fmt"
)
// CommandError happens when use command in invalid way
type CommandError struct {
command string
reason string
}
func (e CommandError) Error() string {
return fmt.Sprintf("invalid usage of \"%s\" command, reason: %s, please try \"help %s\" for more information", e.command, e.reason, e.command)
}
// BucketError happens when access bucket error
type BucketError struct {
err error
bucket string
}
func (e BucketError) Error() string {
return fmt.Sprintf("%s, Bucket=%s", e.err.Error(), e.bucket)
}
// ObjectError happens when access object error
type ObjectError struct {
err error
bucket string
object string
}
func (e ObjectError) Error() string {
return fmt.Sprintf("%s, Bucket=%s, Object=%s", e.err.Error(), e.bucket, e.object)
}
// FileError happens when access file error
type FileError struct {
err error
file string
}
func (e FileError) Error() string {
return fmt.Sprintf("%s, File=%s", e.err.Error(), e.file)
}
type CopyError struct {
err error
}
func (e CopyError) Error() string {
return e.err.Error()
}