Skip to content
Myr

Improve error message for null/undefined to res.status

Before adoption: this commit came in with the history the project adopted, so no landing records it.

closes #2795 closes #2797 closes #3111

authored by Joshua Caron · committed by Douglas Christopher Wilson · parent 6bcdfef · Browse files · 3 files+37 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+37 added−0 removed

  • tests:+32 added−0 removed
  • other:+5 added−0 removed

3 files+37 added−0 removed

modified:lib/response.js+4 added
62 unmodified lines
63 * @public64 */6566res.status = function status(code) {67 if (code === undefined || code === null) {68 throw new TypeError('code argument is required to res.status')69 }7071 this.statusCode = code;72 return this;73};74
1071 unmodified lines
modified:test/res.status.js+32 added
modified:History.md+1 added
1unreleased2==========34 * Improve error message for non-strings to `res.sendFile`5 * Improve error message for `null`/`undefined` to `res.status`674.16.4 / 2018-10-108===================9
3418 unmodified lines