-
Notifications
You must be signed in to change notification settings - Fork 4
/
error.go
48 lines (40 loc) · 1.17 KB
/
error.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package mahi
// General errors.
const (
ErrUnauthorized = Error("unauthorized")
ErrInternal = Error("internal error")
ErrInvalidDate = Error("invalid date")
ErrNotFound = Error("resource not found")
ErrBadRequest = Error("bad request")
ErrInvalidJSON = Error("invalid json")
)
const (
ErrAuthorizationHeaderMissing = Error("authorization header is missing")
)
// Usage errors
const (
ErrUsageNotFound = Error("usage not found")
)
// Application errors
const (
ErrApplicationNotFound = Error("application not found")
ErrApplicationNameTaken = Error("application name taken")
)
// Storage errors
const (
ErrBucketNotFound = Error("bucket does not exist")
ErrInvalidBucketName = Error("invalid bucket name")
ErrInvalidStorageKey = Error("invalid api keys or api keys do not have correct permissions")
)
// File errors
const (
ErrFileNotFound = Error("file not found")
ErrFileToLargeToTransform = Error("file is to large to transform")
ErrTransformationNotUnique = Error("transformation is not unique")
)
// Error represents a Mahi error.
type Error string
// Error returns the error message.
func (e Error) Error() string {
return string(e)
}