Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the same error codes as provided by 3scale backend #14

Open
MarkCheshire opened this issue May 24, 2014 · 1 comment
Open

Return the same error codes as provided by 3scale backend #14

MarkCheshire opened this issue May 24, 2014 · 1 comment

Comments

@MarkCheshire
Copy link

https://support.3scale.net/forum/topics/threescale-client-authrep-doesn-t-return-error_code-on-throttled-requests

The API doc says that authorize() returns a 409 status code and a reason message when a request is denied due to throttling. The Ruby client swallows the status code, so I have to parse the error_message. It would be nice to set the @error_code. Here’s an example response:

#<ThreeScale::AuthorizeResponse:0×007ffbdc702620 @usage_reports=
[#<ThreeScale::AuthorizeResponse::UsageReport:0×007ffbe1dbca10 
@metric=“hits”, @period=:minute, @period_start=“2014-05-23 19:40:00 +0000”, 
@period_end=“2014-05-23 19:41:00 +0000”, @current_value=1, @max_value=1>], 
@error_code=nil, @error_message=“usage limits are exceeded”, @plan=“Test Plan”>
@mpguerra
Copy link
Contributor

mpguerra commented Aug 6, 2014

The way the ruby plugin currently works is that the error code is not the http status code, but a 3scale error code which used to be sent as an attribute of the xml response sent and looked something like this:

<error code="application_not_found">application with id="foo" was not found</error>

This is no longer present when making calls that fail, however we need to think carefully about how to change this to ensure that this isn’t breaking anything else instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants