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

Middleware Context Question #42

Open
enderv opened this issue Jun 13, 2017 · 3 comments
Open

Middleware Context Question #42

enderv opened this issue Jun 13, 2017 · 3 comments

Comments

@enderv
Copy link

enderv commented Jun 13, 2017

Been playing around a bit and so far this is pretty awesome. Have a question about the logging however.

In the documentation it lists this example

app.use(scope, (ctx, next) => {
  // Log the request, response and continue
  console.log('Request:', ctx.req);
  return next().then((result) => {
    console.log('Response:', result);
  }).catch((error) => {
    console.log('Logging error', error);
  });
});

However I would be able to like to log the ctx.req with the result or error. So far the only idea I've had is just to tack on the context to the implementation return or error and then remove it from the result/ Error after logging. Just wanted to see if there was a better way to go about this that I might be missing.

Thanks!

@c3s4r
Copy link
Member

c3s4r commented Jun 20, 2017

Hi. There are some issues in the error handling in the current implementation. I will be working on it during this week, and fixing it in 1.6, which should be released during this or next week.

@sgraham785
Copy link

any updates on this?

@c3s4r
Copy link
Member

c3s4r commented Aug 9, 2017

No, sorry, I've been busy on other projects, and I haven't been able to work on this.

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

3 participants