fn: error handling updates (#1337)

* docker-pull timeout is now a 504 which classifies it as a
service error. Avoid using 503 to make sure LB does not retry.

* Only applicable to detached mode, a timeout on LB is
now a ErrServiceReservationFailure (500). In detached mode,
this is unlikely to make it back to a client and it is mostly
for documentation/metrics purposes.
  
* For Triggers, avoid scrubbing service code.
This commit is contained in:
Tolga Ceylan
2018-12-03 14:58:48 -08:00
committed by GitHub
parent 3818046351
commit a9a828cc40
3 changed files with 26 additions and 15 deletions

View File

@@ -37,7 +37,7 @@ var (
error: errors.New("Timed out - server too busy"),
}
ErrDockerPullTimeout = err{
code: http.StatusServiceUnavailable,
code: http.StatusGatewayTimeout,
error: errors.New("Docker pull timed out"),
}
ErrContainerInitTimeout = err{
@@ -188,7 +188,10 @@ var (
code: http.StatusInternalServerError,
error: errors.New("Unable to find the call handle"),
}
ErrServiceReservationFailure = err{
code: http.StatusInternalServerError,
error: errors.New("Unable to service the request for the reservation period"),
}
ErrContainerInitFail = err{
code: http.StatusBadGateway,
error: errors.New("container failed to initialize, please ensure you are using the latest fdk / format and check the logs"),