Skip to content

Commit 37df302

Browse files
committed
Add Errors section to the README
1 parent 61970cd commit 37df302

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,18 @@ puts response["text"]
455455
# => "Transcription of the text"
456456
```
457457

458+
#### Errors
459+
460+
HTTP errors can be caught like this:
461+
462+
```
463+
begin
464+
OpenAI::Client.new.models.retrieve(id: "text-ada-001")
465+
rescue Faraday::Error => e
466+
raise "Got a Faraday error: #{e}"
467+
end
468+
```
469+
458470
## Development
459471

460472
After checking out the repo, run `bin/setup` to install dependencies. You can run `bin/console` for an interactive prompt that will allow you to experiment.

0 commit comments

Comments
 (0)