intercom/intercom-ruby — pull request #52 by infertux (2013-10-14 23:21:12+00:00)
Title: Raise Intercom::ServiceUnavailableError when endpoint returns 502

Hi, the Gem used to raise this exception when the endpoint would return _502 Bad Gateway_ (which happens from time to time):

```html
JSON::ParserError: 757: unexpected token at '

502 Bad Gateway

502 Bad Gateway

nginx/1.4.2

'
```

This change makes it raise `Intercom::ServiceUnavailableError` instead so it can be rescued reliably in our apps.