Handle InvalidRequestError responses that don't contain a param

Before this change, the test fails with TypeError instead because the error handling code is trying to index into a string because it expects a hash.

I'm guessing the error json changed at some point? I think this should handle both ways in case you change your mind, but if you've solidified the way you're representing errors and will only ever send one way, let me know and I'll be happy to update this PR.

Thanks!!! <3