File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -230,9 +230,9 @@ function safelyExtractBody (object, keepalive = false) {
230
230
if ( object instanceof ReadableStream ) {
231
231
// Assert: object is neither disturbed nor locked.
232
232
// istanbul ignore next
233
- assert ( ! util . isDisturbed ( object ) , 'disturbed ' )
233
+ assert ( ! util . isDisturbed ( object ) , 'The body has already been consumed. ' )
234
234
// istanbul ignore next
235
- assert ( ! object . locked , 'locked' )
235
+ assert ( ! object . locked , 'The stream is locked. ' )
236
236
}
237
237
238
238
// 2. Return the results of extracting object.
@@ -266,11 +266,11 @@ async function * consumeBody (body) {
266
266
const stream = body . stream
267
267
268
268
if ( util . isDisturbed ( stream ) ) {
269
- throw new TypeError ( 'disturbed ' )
269
+ throw new TypeError ( 'The body has already been consumed. ' )
270
270
}
271
271
272
272
if ( stream . locked ) {
273
- throw new TypeError ( 'locked' )
273
+ throw new TypeError ( 'The stream is locked. ' )
274
274
}
275
275
276
276
// Compat.
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ test('locked blob body', (t) => {
250
250
const res = await fetch ( `http://localhost:${ server . address ( ) . port } ` )
251
251
const reader = res . body . getReader ( )
252
252
res . blob ( ) . catch ( err => {
253
- t . equal ( err . message , 'locked' )
253
+ t . equal ( err . message , 'The stream is locked. ' )
254
254
reader . cancel ( )
255
255
} )
256
256
} )
@@ -270,7 +270,7 @@ test('disturbed blob body', (t) => {
270
270
t . pass ( 2 )
271
271
} )
272
272
res . blob ( ) . catch ( err => {
273
- t . equal ( err . message , 'disturbed ' )
273
+ t . equal ( err . message , 'The body has already been consumed. ' )
274
274
} )
275
275
} )
276
276
} )
You can’t perform that action at this time.
0 commit comments