-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
28 lines (24 loc) · 838 Bytes
/
errors.go
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
package tus
import (
"errors"
"fmt"
)
var (
ErrChuckSize = errors.New("chunk size must be greater than zero.")
ErrNilLogger = errors.New("logger can't be nil.")
ErrNilStore = errors.New("store can't be nil if Resume is enable.")
ErrNilUpload = errors.New("upload can't be nil.")
ErrLargeUpload = errors.New("upload body is to large.")
ErrVersionMismatch = errors.New("protocol version mismatch.")
ErrOffsetMismatch = errors.New("upload offset mismatch.")
ErrUploadNotFound = errors.New("upload not found.")
ErrResumeNotEnabled = errors.New("resuming not enabled.")
ErrFingerprintNotSet = errors.New("fingerprint not set.")
)
type ClientError struct {
Code int
Body []byte
}
func (c ClientError) Error() string {
return fmt.Sprintf("unexpected status code: %d", c.Code)
}