yada

danielneal 2022-12-01T13:46:45.662469Z

heya, does anyone know if it’s possible to get the original ctx in a yada error-handler. I’m trying to log the body of a POST request when there’s an error, but the processed request body is not present

mccraigmccraig 2023-02-02T21:56:49.509199Z

iirc the body is (sometimes, perhaps not always) in a stateful InputStream, and once that is consumed it's gone - unless you keep a reference to whatever you parsed out of the InputStream so you could add an interceptor to read the InputStream, add the parsed value to the ctx and put a ByteArrayInputStream back in to the ctx to replace the original InputStream

danielneal 2023-02-05T12:09:57.289209Z

thanks so much!

2023-02-14T01:43:20.195169Z

there should be a PR by me on the yada repo that does just this

2023-02-14T01:44:06.883899Z

my PR gives the CTX up to the error, and then starts the error interceptors with that ctx. if that is what you need then look at that PR