swagger-node-runner icon indicating copy to clipboard operation
swagger-node-runner copied to clipboard

json_error_handler elusive error

Open Celadora opened this issue 9 years ago • 0 comments

in fittings/json_error_handler.js there is a "TODO: find what's throwing here..."

line 41: delete(context.error);

is the culprit. This cannot be deleted or set to null, or the middleware will fail to resolve next(); I don't know entirely why, and setting it to null will also cause a failure. I suspect that Express is expecting this field to be an Error object, and so ignores calls to next that are missing that property.

To fix this, and prevent leaking error information, please change line 41 in fittings/json_error_handler.js to:

context.error = new Error(null);

Celadora avatar Jan 26 '17 22:01 Celadora