Skip to content

Error Handling

Peter Goldstein edited this page Jan 16, 2023 · 1 revision

One of the key features Asimov provides is a well-structured set of exceptions. This allows applications to handle different types of errors appropriately - with retries, changes to parameters, or configuration changes.

At the highest level, errors in Asimov are broken into three types:

Asimov::ConfigurationError - Configuration errors for the parameters used to initialize an Asimov::Client. These can be detected at client initialization time.

Asimov::NetworkError - Network errors generated when attempting to reach the OpenAI API. These generally indicate a temporary inability to communicate with the OpenAI API or a significant network configuration error that needs to be remediated.

Asimov::RequestError - Request errors are generated by OpenAI itself, and are translations of the HTTP error code and any additional information provided by the client. They generally indicate an error with request parameters, an attempt to perform an unsupported action, or invalid authentication credentials.