Skip to content

Commit c06fcdc

Browse files
committed
Fix name of base Intercom error class in README
The base class for all intercom errors is `Intercom::IntercomError`, not `Intercom::Error`, as the README previously stated.
1 parent 398f703 commit c06fcdc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ intercom = Intercom::Client.new(app_id: 'my_app_id', api_key: 'my_api_key')
3434

3535
You can get your `app_id` from the URL when you're logged into Intercom (it's the alphanumeric just after `/apps/`) and your API key from the API keys integration settings page (under your app settings - integrations in Intercom).
3636

37-
```ruby
37+
```ruby
3838
# With an OAuth token:
3939
intercom = Intercom::Client.new(token: 'my_token')
4040
```
@@ -444,10 +444,9 @@ intercom.jobs.errors(id: 'job_abcd1234')
444444

445445
There are different styles for error handling - some people prefer exceptions; some prefer nil and check; some prefer error objects/codes. Balancing these preferences alongside our wish to provide an idiomatic gem has brought us to use the current mechanism of throwing specific exceptions. Our approach in the client is to propagate errors and signal our failure loudly so that erroneous data does not get propagated through our customers' systems - in other words, if you see a `Intercom::ServiceUnavailableError` you know where the problem is.
446446

447-
You do not need to deal with the HTTP response from an API call directly. If there is an unsuccessful response then an error that is a subclass of `Intercom::Error` will be raised. If desired, you can get at the http_code of an `Intercom::Error` via its `http_code` method.
447+
You do not need to deal with the HTTP response from an API call directly. If there is an unsuccessful response then an error that is a subclass of `Intercom::IntercomError` will be raised. If desired, you can get at the http_code of an `Intercom::IntercomError` via its `http_code` method.
448448

449-
The list of different error subclasses are listed below. As they all inherit off Intercom::IntercomError you can choose to rescue Intercom::IntercomError or
450-
else rescue the more specific error subclass.
449+
The list of different error subclasses are listed below. As they all inherit off Intercom::IntercomError you can choose to rescue Intercom::IntercomError or else rescue the more specific error subclass.
451450

452451
```ruby
453452
Intercom::AuthenticationError

0 commit comments

Comments
 (0)