levibostian / ExpressjsBlanky

Blank Express.js project to get up and running FAST.
MIT License
7 stars 0 forks source link

Use context properly in Honeybadger #39

Closed levibostian closed 3 years ago

levibostian commented 4 years ago

The context feature is cool but I am using it wrong. I know I am because when an error happens, it gives me the context for the request that previously happened.

levibostian commented 3 years ago

I think I know why this was happening. I was calling Honeybadger.resetContext() only when the server started up. I was not calling it on every request.

I created a middleware that runs before all other middlewares that runs this.