forked from k1LoW/runn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
33 lines (20 loc) · 880 Bytes
/
errors.go
File metadata and controls
33 lines (20 loc) · 880 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
package runn
import "fmt"
type BeforeFuncError struct{ err error }
func (e *BeforeFuncError) Error() string { return fmt.Errorf("before func error: %w", e.err).Error() }
func (e *BeforeFuncError) Unwrap() error { return e.err }
func newBeforeFuncError(err error) *BeforeFuncError {
return &BeforeFuncError{err: err}
}
type AfterFuncError struct{ err error }
func (e *AfterFuncError) Error() string { return fmt.Errorf("after func error: %w", e.err).Error() }
func (e *AfterFuncError) Unwrap() error { return e.err }
func newAfterFuncError(err error) *AfterFuncError {
return &AfterFuncError{err: err}
}
type ErrUnrecoverable struct{ err error }
func (e *ErrUnrecoverable) Error() string { return e.err.Error() }
func (e *ErrUnrecoverable) Unwrap() error { return e.err }
func newErrUnrecoverable(err error) *ErrUnrecoverable {
return &ErrUnrecoverable{err: err}
}