MCPcopy Create free account
hub / github.com/openclaw/gogcli / isRetryableDocsImageInsertError

Function isRetryableDocsImageInsertError

internal/cmd/docs_import.go:325–338  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

323}
324
325func 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).

Callers 1

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected