-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
38 lines (30 loc) · 770 Bytes
/
errors.go
File metadata and controls
38 lines (30 loc) · 770 Bytes
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
package maml
import "fmt"
// ParseError represents an error encountered during parsing.
type ParseError struct {
Message string
Line int
}
func (e *ParseError) Error() string {
return e.Message
}
func newParseError(formatted string, line int) *ParseError {
return &ParseError{
Message: formatted,
Line: line,
}
}
// MarshalError represents an error encountered during marshaling.
type MarshalError struct {
Message string
}
func (e *MarshalError) Error() string {
return fmt.Sprintf("maml: marshal error: %s", e.Message)
}
// UnmarshalError represents an error encountered during unmarshaling.
type UnmarshalError struct {
Message string
}
func (e *UnmarshalError) Error() string {
return fmt.Sprintf("maml: unmarshal error: %s", e.Message)
}