error: prefix 'Err' to be namespaceless

This commit is contained in:
Adrien Marquès 2018-05-20 10:41:17 +02:00
parent 5438680867
commit 7f8910f793
1 changed files with 19 additions and 19 deletions

View File

@ -13,35 +13,35 @@ type Err struct {
var ( var (
/* Base */ /* Base */
Success = &Err{0, "all right", nil} ErrSuccess = &Err{0, "all right", nil}
Failure = &Err{1, "it failed", nil} ErrFailure = &Err{1, "it failed", nil}
Unknown = &Err{-1, "", nil} ErrUnknown = &Err{-1, "", nil}
NoMatchFound = &Err{2, "no resource found", nil} ErrNoMatchFound = &Err{2, "no resource found", nil}
AlreadyExists = &Err{3, "resource already exists", nil} ErrAlreadyExists = &Err{3, "resource already exists", nil}
Config = &Err{4, "configuration error", nil} ErrConfig = &Err{4, "configuration error", nil}
/* I/O */ /* I/O */
UploadError = &Err{100, "upload failed", nil} ErrUpload = &Err{100, "upload failed", nil}
DownloadError = &Err{101, "download failed", nil} ErrDownload = &Err{101, "download failed", nil}
MissingDownloadHeaders = &Err{102, "download headers are missing", nil} ErrMissingDownloadHeaders = &Err{102, "download headers are missing", nil}
MissingDownloadBody = &Err{103, "download body is missing", nil} ErrMissingDownloadBody = &Err{103, "download body is missing", nil}
/* Controllers */ /* Controllers */
UnknownController = &Err{200, "unknown controller", nil} ErrUnknownController = &Err{200, "unknown controller", nil}
UnknownMethod = &Err{201, "unknown method", nil} ErrUnknownMethod = &Err{201, "unknown method", nil}
UncallableController = &Err{202, "uncallable controller", nil} ErrUncallableController = &Err{202, "uncallable controller", nil}
UncallableMethod = &Err{203, "uncallable method", nil} ErrUncallableMethod = &Err{203, "uncallable method", nil}
/* Permissions */ /* Permissions */
Permission = &Err{300, "permission error", nil} ErrPermission = &Err{300, "permission error", nil}
Token = &Err{301, "token error", nil} ErrToken = &Err{301, "token error", nil}
/* Check */ /* Check */
MissingParam = &Err{400, "missing parameter", nil} ErrMissingParam = &Err{400, "missing parameter", nil}
InvalidParam = &Err{401, "invalid parameter", nil} ErrInvalidParam = &Err{401, "invalid parameter", nil}
InvalidDefaultParam = &Err{402, "invalid default param", nil} ErrInvalidDefaultParam = &Err{402, "invalid default param", nil}
) )
// BindArgument adds an argument to the error // BindArgument adds an argument to the error