mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-26 01:51:29 +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
|
||||
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 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
|
||||
} else {
|
||||
log.Warn().Err(lastError).Msgf("request failed after %d/%d retries, retrying", attempt, maxRetry)
|
||||
}
|
||||
|
||||
// Wait before next attempt
|
||||
|
||||
Reference in New Issue
Block a user