Provide error_info in error
njcameron opened this issue · comments
Thanks so much for putting this gem together, we've built our whole Pipedrive integration around it.
I have one request: I was debugging a particularly tricky API request and kept receiving the error
<Pipedrive::UnkownAPIError: HTTP request is not valid>
It was only once I did a request directly and I could inspect what I got back did I see:
{"success"=>false, "statusCode"=>10009, "error"=>"HTTP request is not valid", "error_info"=>"Either 'infinite' or 'cyclesCount' must be specified.", "data"=>nil}
Returning this specific error info would be a huge developer experience improvement
Glad the gem is been useful 🙂, I actually started it - as part of our integration too - imaging it could serve others.
Your suggestion is definitely a good one, I will add a small layer of error handling with better or more explicit error messages.
Thanks for taking the time to suggest such improvement.
Amazing thanks @j4rs, appreciate it!
@njcameron Here is the PR #20 - in case you want to check it out before the merge 🙂 - thanks.
Brilliant, thanks Jorge!