I'm trying to make a "meeting_delete" request to an inexistent ID and I'm seeing a non expected behaviro.
What I expect is for the client to raise a Zoom::NotFound error, as the request status_code is 404.
As I dig a bit into this repository codebase, I found myself in this part:
def raise_if_error!(response, http_code=200)
return response unless response.is_a?(Hash) && response.key?('code')
code = response['code']
error_hash = build_error(response)
raise AuthenticationError, error_hash if code == 124
raise BadRequest, error_hash if code == 400
raise Unauthorized, error_hash if code == 401
raise Forbidden, error_hash if code == 403
raise NotFound, error_hash if code == 404
raise Conflict, error_hash if code == 409
raise TooManyRequests, error_hash if code == 429
raise InternalServerError, error_hash if code == 500
raise Error.new(error_hash, error_hash)
end
Which should properly map code 404 to NotFound right?
But, the http_response is returning a hash with the following content:
{"code"=>3001, "message"=>"Meeting is not found or has expired."}
And this weird code 3001 is the code mapped in the method raise_if_error! above.
I checked and the http_response actually is 404.
So, I guess Zoom has internally different code for different issues, but the regular HTTP status code remains as expected (404 for non existing resources)
Perhaps this mapping of code and Error should be using http_code and not response['code']?
Hi all! Thanks for you hard work :)
I'm trying to make a "meeting_delete" request to an inexistent ID and I'm seeing a non expected behaviro. What I expect is for the client to raise a
Zoom::NotFound
error, as the request status_code is 404. As I dig a bit into this repository codebase, I found myself in this part:Which should properly map code 404 to
NotFound
right?But, the
http_response
is returning a hash with the following content:And this weird code 3001 is the code mapped in the method
raise_if_error!
above. I checked and the http_response actually is 404.So, I guess Zoom has internally different code for different issues, but the regular HTTP status code remains as expected (404 for non existing resources)
Perhaps this mapping of code and Error should be using http_code and not response['code']?
Thanks!