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

EMG returns null value for err parameter in onerror_request hook in a custom plug-in #108

Open
csilsantos opened this issue Mar 8, 2017 · 1 comment

Comments

@csilsantos
Copy link

Using Apigee Edgemicro version 2.3.3 (latest release at this time), If I call an API proxy that exists in Apigee Cloud but this API proxy has an unavailable target endpoint, NONE of the "onresponse hooks" are called and the onerror_request is called.

However, in onerror_request: function(req, res, err, next) hook, the err parameter comes with NULL value, therefore its not possible to handle the error. This was previously discussed in the community forums, onerror_request and onerror_response hooks in custom plugins to handle errors .

Ex.: If I call:

curl -v http://localhost:8000/ping

where /ping as a unavailable target endpoint.

and in my plug-in, simply get the err parameter and print out:

onerror_request: function(req, res, err, next) {
  debug('plugin onerror_request ' + err);
  next();
}

i got the response in the EMG logs:

plugin:custom-test plugin onerror_request null

Thanks!

@mdobson
Copy link
Contributor

mdobson commented Mar 8, 2017

I'll take a look at this. Thanks.

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