From 6f7987593a9db5500fa56fef0ec1845a02df9876 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 2 Jul 2023 14:52:06 +0800 Subject: Refactor: move task error types to separate package. --- common/errors.go | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 common/errors.go (limited to 'common/errors.go') diff --git a/common/errors.go b/common/errors.go deleted file mode 100644 index bdf49fb..0000000 --- a/common/errors.go +++ /dev/null @@ -1,43 +0,0 @@ -package common - -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} -} -- cgit v1.2.3