mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 12:53:41 +00:00
包名重构
This commit is contained in:
1 parent
fb45066228
commit
8298051c81
37 files changed
+220
-134
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package tracker
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ErrorCode int
|
||||
|
||||
const (
|
||||
ErrTimeout ErrorCode = -1
|
||||
ErrResponse ErrorCode = -2
|
||||
)
|
||||
|
||||
type BtError interface {
|
||||
error
|
||||
}
|
||||
|
||||
type TrackerError struct {
|
||||
Code ErrorCode
|
||||
Err error
|
||||
}
|
||||
|
||||
func (te *TrackerError) Error() string {
|
||||
return fmt.Sprintf("%s:%d", te.Err.Error(), te.Code)
|
||||
}
|
||||
|
||||
func NewTrackerError(code ErrorCode, err error) *TrackerError {
|
||||
return &TrackerError{code, err}
|
||||
}
|
||||
Reference in new issue
Block a user