Errors
When the API returns a non-success status code, we return an error with type*telnyx.Error. This contains the StatusCode, *http.Request, and
*http.Response values of the request, as well as the JSON of the error body
(much like other response objects in the SDK).
To handle errors, we recommend that you use the errors.As pattern:
*url.Error wrapping *net.OpError.
Timeouts
Requests do not time out by default; use context to configure a timeout for a request lifecycle. Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, useoption.WithRequestTimeout().
Retries
Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors. You can use theWithMaxRetries option to configure or disable this: