jochen-schweizer / express-prom-bundle

express middleware with standard prometheus metrics in one bundle
MIT License
310 stars 68 forks source link

fix: handle errors from prom-client #78

Closed FauxFaux closed 3 years ago

FauxFaux commented 3 years ago

When prom-client returns an error, pass that on to express so the app can return a 500.

next wasn't set, so couldn't be called, and we need to have not sent a 200 before calling next.

(Also, please switch to a test framework which shows stack traces, so that this would have taken two minutes instead of an hour.)

disjunction commented 3 years ago

Thanks for fixing this, good catch.

As for the test framework - I agree, it definitely begs for an update. It's a pretty old lib, so the dev. tools are way outdated.