(err error)
| 323 | } |
| 324 | |
| 325 | func isRetryableDocsImageInsertError(err error) bool { |
| 326 | var apiErr *gapi.Error |
| 327 | if errors.As(err, &apiErr) { |
| 328 | if apiErr.Code >= 500 { |
| 329 | return true |
| 330 | } |
| 331 | if apiErr.Code == 400 && strings.Contains(apiErr.Message, "retrieving the image") { |
| 332 | return true |
| 333 | } |
| 334 | } |
| 335 | errStr := err.Error() |
| 336 | return strings.Contains(errStr, "retrieving the image") || |
| 337 | strings.Contains(errStr, "provided image should be publicly accessible") |
| 338 | } |
| 339 | |
| 340 | // defaultImageMaxWidthPt is the maximum width for inserted inline images in points. |
| 341 | // 468pt = US Letter (612pt) minus default 1-inch margins (72pt each side). |
no test coverage detected