-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
31 lines (25 loc) · 894 Bytes
/
Copy patherrors.go
File metadata and controls
31 lines (25 loc) · 894 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
package logevent
import (
"errors"
"fmt"
"reflect"
)
var _ error = new(DifferentLogEventTypeError)
var (
// ErrLogEventNotInitialized error returned when adding context to a log event.
// but the log event was not initialized.
ErrLogEventNotInitialized = errors.New("LogEvent not initialized")
// ErrUpdatingLoggedEvent error returned when trying to update a log event that has already been logged.
ErrUpdatingLoggedEvent = errors.New("LogEvent already logged")
)
type (
// DifferentLogEventTypeError is returned when the log event type is different from the previous one.
DifferentLogEventTypeError struct {
previousType reflect.Type
currentType reflect.Type
}
)
// Error implements the error interface.
func (l DifferentLogEventTypeError) Error() string {
return fmt.Sprintf("LogEvent type mismatch: previous type %v, current type %v", l.previousType, l.currentType)
}