Cloudflare errors are returned as *d1http.APIError.
_, err := client.Raw(ctx, "INVALID SQL")
var apiErr *d1http.APIError
if errors.As(err, &apiErr) {
fmt.Println(apiErr.StatusCode)
fmt.Println(apiErr.Errors)
}Helpers:
d1http.IsRateLimited(err)
d1http.IsNotFound(err)
d1http.IsRetryable(err)Retries are applied to:
4295xx
Configure:
client := d1http.New(d1http.Config{
AccountID: "...",
APIToken: "...",
Retry: d1http.RetryConfig{
MaxRetries: 3,
},
})