asonas / chatwork-ruby

MIT License
64 stars 27 forks source link

APIConnectionError#status is always nil #67

Closed jmatsu closed 5 years ago

jmatsu commented 5 years ago

I haven't seen APIConnectionError has happened on the production environment so this is not a bug report.

APIConnectionError#status is always nil actually. This seems to be by design though, I would like to handle errors based on the HTTP status of the responses

https://github.com/asonas/chatwork-ruby/blob/aa753b165c1dea3fbe8f8cb692b737fc78debe62/lib/chatwork/chatwork_error.rb#L41

It sounds APIConnectionError happens iff a response from the Chatwork server is not a valid format. I'm unsure how frequent it has happened though, I think APIConnectionError must also have the status field because it's originally from HTTP requests, even if that's like an illegal case on the Chatwork domain. What do you think?

sue445 commented 5 years ago

@jmatsu I fixed at #68 and released v0.12.1

jmatsu commented 5 years ago

Sure! Thank you for your quick fixing. 😍