Usage
File uploads
Request parameters that correspond to file uploads can be passed as raw contents, aPathname instance, StringIO, or more.
IO descriptor, but this disables retries, as the library can’t be sure if the descriptor is a file or pipe (which cannot be rewound).
Handling errors
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass ofTelnyx::Errors::APIError will be thrown:
Retries
Certain errors will be automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default. You can use themax_retries option to configure or disable this:
Timeouts
By default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:Telnyx::Errors::APITimeoutError is raised.
Note that requests that time out are retried by default.