wordnik/swagger-node-express — pull request #78 by pascal-bach (2013-11-19 21:37:19+00:00)
Title: Replace the exported errorHanlder with a throwError function.

Just exporting the error handler doesn't work with custom error handlers set via setErrorHandler.
For this to work an extra wrapper function throwError is needed.

Example:
swagger.throwError(req, res, swagger.errors.notFound('User'));