moreinterp/coreutils/error.go
raw| 1 | package coreutils |
| 2 | |
| 3 | import "fmt" |
| 4 | |
| 5 | // Error wraps any error returned from the core utilities. |
| 6 | type Error struct { |
| 7 | err error |
| 8 | } |
| 9 | |
| 10 | var ( |
| 11 | _ error = &Error{} |
| 12 | _ interface{ Unwrap() error } = &Error{} |
| 13 | ) |
| 14 | |
| 15 | func (err *Error) Error() string { |
| 16 | return fmt.Sprintf("coreutils: %v", err.err) |
| 17 | } |
| 18 | |
| 19 | func (err *Error) Unwrap() error { |
| 20 | return err.err |
| 21 | } |