Configurable function level timeout (#1284)

This commit is contained in:
parauliya
2019-09-10 23:28:08 +08:00
committed by Ta-Ching Chen
parent 78026ac573
commit 678a2c7ad8
9 changed files with 71 additions and 11 deletions
+4
View File
@@ -56,6 +56,8 @@ func MakeErrorFromHTTP(resp *http.Response) error {
errCode = ErrorNotFound
case http.StatusConflict:
errCode = ErrorNameExists
case http.StatusRequestTimeout:
errCode = ErrorRequestTimeout
default:
errCode = ErrorInternal
}
@@ -128,6 +130,7 @@ const (
ErrorNotImplmented
ErrorChecksumFail
ErrorSizeLimitExceeded
ErrorRequestTimeout
)
// must match order and len of the above const
@@ -141,4 +144,5 @@ var errorDescriptions = []string{
"Not implemented",
"Checksum verification failed",
"Size limit exceeded",
"Request time limit exceeded",
}