blob: 82f2fecc50b89c79c8ce9e0310ab314406465e8e (
plain)
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
|
package field
import "fmt"
// Read error
type ReadError struct {
err error
}
func (e ReadError) Error() string {
return fmt.Sprintf("Failed to decode file")
}
func (e ReadError) Unwrap() error { return e.err }
func newReadError(err error) error {
return &ReadError{
err: err,
}
}
// Funge decoding error
type DecodeError struct {
msg string
}
func (e DecodeError) Error() string {
return fmt.Sprintf("Failed to decode file with message : %s", e.msg)
}
func newDecodeError(msg string) error {
return &DecodeError{
msg: msg,
}
}
|