mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 06:23:52 +08:00
change: update logs
This commit is contained in:
@@ -204,12 +204,13 @@ func (s *DriverSession) RequestWithRetry(method string, urlStr string, rawBody [
|
|||||||
|
|
||||||
// Notice: use DeviceHTTPDriverError when request driver failed
|
// Notice: use DeviceHTTPDriverError when request driver failed
|
||||||
lastError = errors.Wrap(code.DeviceHTTPDriverError, err.Error())
|
lastError = errors.Wrap(code.DeviceHTTPDriverError, err.Error())
|
||||||
log.Warn().Err(err).Msgf("request failed, attempt %d/%d", attempt, maxRetry)
|
|
||||||
|
|
||||||
// If this was the last attempt, break
|
// If this was the last attempt, break
|
||||||
if attempt == maxRetry {
|
if attempt == maxRetry {
|
||||||
log.Error().Err(lastError).Msgf("all %d retry attempts failed, giving up", maxRetry)
|
log.Error().Err(lastError).Msgf("request failed after %d retries, giving up", maxRetry)
|
||||||
break
|
break
|
||||||
|
} else {
|
||||||
|
log.Warn().Err(lastError).Msgf("request failed after %d/%d retries, retrying", attempt, maxRetry)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait before next attempt
|
// Wait before next attempt
|
||||||
|
|||||||
Reference in New Issue
Block a user