| 1 |
|
| 2 |
|
| 3 |
package mount |
| 4 |
|
| 5 |
import "strconv" |
| 6 |
|
| 7 |
|
| 8 |
type mountError struct { |
| 9 |
op string |
| 10 |
source, target string |
| 11 |
flags uintptr |
| 12 |
data string |
| 13 |
err error |
| 14 |
} |
| 15 |
|
| 16 |
func (e *mountError) Error() string { |
| 17 |
out := e.op + " " |
| 18 |
|
| 19 |
if e.source != "" { |
| 20 |
out += e.source + ":" + e.target |
| 21 |
} else { |
| 22 |
out += e.target |
| 23 |
} |
| 24 |
|
| 25 |
if e.flags != uintptr(0) { |
| 26 |
out += ", flags: 0x" + strconv.FormatUint(uint64(e.flags), 16) |
| 27 |
} |
| 28 |
if e.data != "" { |
| 29 |
out += ", data: " + e.data |
| 30 |
} |
| 31 |
|
| 32 |
out += ": " + e.err.Error() |
| 33 |
return out |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
func (e *mountError) Cause() error { |
| 39 |
return e.err |
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
func (e *mountError) Unwrap() error { |
| 45 |
return e.err |
| 46 |
} |