koajs / static

Static file server middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

this module ignores errors

75lb opened this issue · comments

this line leads to unreported errors and my Koa app failing silently:
https://github.com/koajs/static/blob/master/index.js#L44

I had a bug in upstream middleware which I had no idea about, as the error ("Can't set headers after they are sent.") was being swallowed by the above line.

It doesn't seem good practise to ignore errors, it reminds me of on error resume next in the dark days of Visual Basic. Can this be avoided?

e23cfca

v4.0.1 published :)

cc @75lb thx