diff options
author | Keuin <[email protected]> | 2023-07-02 16:12:13 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-02 16:12:13 +0800 |
commit | 76a7674dae069e0be15bed6af8450ad214f8dde2 (patch) | |
tree | 5b0f1b09ce3c212c5dcc88d53667421cd3d5ac9d /bilibili/errors/errors.go | |
parent | 6f7987593a9db5500fa56fef0ec1845a02df9876 (diff) |
Refactor: distinct task errors with type enum.
Diffstat (limited to 'bilibili/errors/errors.go')
-rw-r--r-- | bilibili/errors/errors.go | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/bilibili/errors/errors.go b/bilibili/errors/errors.go deleted file mode 100644 index 2b810ed..0000000 --- a/bilibili/errors/errors.go +++ /dev/null @@ -1,43 +0,0 @@ -package errors - -import ( - "fmt" -) - -/* -Task errors. -*/ - -type RecoverableTaskError struct { - err error - message string -} - -func (e *RecoverableTaskError) Error() string { - return fmt.Sprintf("%v: %v", e.message, e.err) -} - -func (e *RecoverableTaskError) Unwrap() error { - return e.err -} - -func NewRecoverableTaskError(message string, err error) error { - return &RecoverableTaskError{message: message, err: err} -} - -type UnrecoverableTaskError struct { - err error - message string -} - -func (e *UnrecoverableTaskError) Error() string { - return fmt.Sprintf("%v: %v", e.message, e.err) -} - -func (e *UnrecoverableTaskError) Unwrap() error { - return e.err -} - -func NewUnrecoverableTaskError(message string, err error) error { - return &UnrecoverableTaskError{message: message, err: err} -} |