condor-framework icon indicating copy to clipboard operation
condor-framework copied to clipboard

Middleware Context Question

Open enderv opened this issue 7 years ago • 3 comments

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!

enderv avatar Jun 13 '17 01:06 enderv

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.

c3s4r avatar Jun 20 '17 22:06 c3s4r

any updates on this?

sgraham785 avatar Aug 09 '17 01:08 sgraham785

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

c3s4r avatar Aug 09 '17 23:08 c3s4r