Skip to content

Commit 8c38486

Browse files
committed
1 parent 298ae67 commit 8c38486

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33

44
* Drop support for Node.js 0.6
55
* Remove `I'mateapot` export; use `ImATeapot` instead
6+
* Rename `UnorderedCollection` constructor to `TooEarly`
67
78
- Replace internal `eval` usage with `Function` constructor
89
- Use instance methods on `process` to check for listeners
10+
11+
- Fix messaging casing of `418 I'm a Teapot`
12+
- Remove code 306
13+
- Rename `425 Unordered Collection` to standard `425 Too Early`
914

1015
2021-11-14 / 1.8.1
1116
==================

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ var err = new createError.NotFound()
133133
|422 |UnprocessableEntity |
134134
|423 |Locked |
135135
|424 |FailedDependency |
136-
|425 |UnorderedCollection |
136+
|425 |TooEarly |
137137
|426 |UpgradeRequired |
138138
|428 |PreconditionRequired |
139139
|429 |TooManyRequests |

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function createError () {
8080
}
8181

8282
if (typeof status !== 'number' ||
83-
(!statuses[status] && (status < 400 || status >= 600))) {
83+
(!statuses.message[status] && (status < 400 || status >= 600))) {
8484
status = 500
8585
}
8686

@@ -91,7 +91,7 @@ function createError () {
9191
// create error
9292
err = HttpError
9393
? new HttpError(msg)
94-
: new Error(msg || statuses[status])
94+
: new Error(msg || statuses.message[status])
9595
Error.captureStackTrace(err, createError)
9696
}
9797

@@ -135,7 +135,7 @@ function createClientErrorConstructor (HttpError, name, code) {
135135

136136
function ClientError (message) {
137137
// create the error object
138-
var msg = message != null ? message : statuses[code]
138+
var msg = message != null ? message : statuses.message[code]
139139
var err = new Error(msg)
140140

141141
// capture a stack trace to the construction point
@@ -204,7 +204,7 @@ function createServerErrorConstructor (HttpError, name, code) {
204204

205205
function ServerError (message) {
206206
// create the error object
207-
var msg = message != null ? message : statuses[code]
207+
var msg = message != null ? message : statuses.message[code]
208208
var err = new Error(msg)
209209

210210
// capture a stack trace to the construction point
@@ -264,7 +264,7 @@ function nameFunc (func, name) {
264264
function populateConstructorExports (exports, codes, HttpError) {
265265
codes.forEach(function forEachCode (code) {
266266
var CodeError
267-
var name = toIdentifier(statuses[code])
267+
var name = toIdentifier(statuses.message[code])
268268

269269
switch (codeClass(code)) {
270270
case 400:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"depd": "2.0.0",
1414
"inherits": "2.0.4",
1515
"setprototypeof": "1.2.0",
16-
"statuses": ">= 1.5.0 < 2",
16+
"statuses": "2.0.1",
1717
"toidentifier": "1.0.1"
1818
},
1919
"devDependencies": {

0 commit comments

Comments
 (0)