petems / riot_api

A Ruby wrapper for the Riot API for League of Legends - https://developer.riotgames.com/api/
MIT License
12 stars 3 forks source link

Error handling now working! :+1: #36

Closed petems closed 10 years ago

petems commented 10 years ago

Also added spec for error-handling option

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-0.0%) when pulling 5f401b23e40a9cfad3950e67e6956bcdd4182c69 on fix_error_handling into 6cc49f8f4d59fb537db1bc8b29d0d707a32632e8 on master.

pcg79 commented 10 years ago

Did you actually have to move the location of the call or was that just a product of your hacking?

And I'm sorry I didn't even notice the raise_status_errors param. Doh! I'm thinking we may want to turn that on by default. Thoughts?

petems commented 10 years ago

I did have to move the location of the call, otherwise it gets overwritten by the other middleware.

I actually added this code originally on the Digital Ocean API gem. The parse issue never occured because Digital Ocean returns JSON for 404, 401s etc. Another thing to ask Riot to implement methinks :+1:

Yeah, it might be better to turn the error handling on by default, and then only turn it off if explicitly set. Will do that now :smile: