forked from microsoft/azure-vhd-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parseError.go
31 lines (27 loc) · 835 Bytes
/
parseError.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
package footer
// ParseError is the error type representing disk footer parse error.
//
type ParseError struct {
FooterField string
err error
}
// Error returns the string representation of the ParseError instance.
//
func (e *ParseError) Error() string {
return "Parse footer field" + " '" + e.FooterField + "' failed: " + e.err.Error()
}
// GetInnerErr returns the inner error, this method satisfies InnerErr interface
//
func (e *ParseError) GetInnerErr() error {
return e.err
}
// NewParseError returns a new ParseError instance.
// The parameter footerField represents the field in the footer that failed to parse
// The parameter err is the underlying error for parse failure.
//
func NewParseError(footerField string, err error) error {
return &ParseError{
FooterField: footerField,
err: err,
}
}