feat(offlinegate): improve error message BE-11402 (#163)

pull/11530/merge
andres-portainer 2024-11-25 17:40:17 -03:00 committed by GitHub
parent 821c1fdbef
commit 4265ae4dae
1 changed files with 2 additions and 2 deletions

View File

@ -41,8 +41,8 @@ func (o *OfflineGate) WaitingMiddleware(timeout time.Duration, next http.Handler
} }
if !o.lock.RTryLockWithTimeout(timeout) { if !o.lock.RTryLockWithTimeout(timeout) {
log.Error().Msg("timeout waiting for the offline gate to signal") log.Error().Str("url", r.URL.Path).Msg("request timed out while waiting for the backup process to finish")
httperror.WriteError(w, http.StatusRequestTimeout, "Timeout waiting for the offline gate to signal", http.ErrHandlerTimeout) httperror.WriteError(w, http.StatusRequestTimeout, "Request timed out while waiting for the backup process to finish", http.ErrHandlerTimeout)
return return
} }
next.ServeHTTP(w, r) next.ServeHTTP(w, r)