@@ -8,7 +8,7 @@ import { MockFetch } from '../test/mock_fetch.js'
8
8
import { base64Encode , streamToString } from '../test/util.js'
9
9
10
10
import { MissingBlobsEnvironmentError } from './environment.js'
11
- import { NF_REQUEST_ID } from './headers.js'
11
+ import { NF_ERROR , NF_REQUEST_ID } from './headers.js'
12
12
import { getDeployStore , getStore , setEnvironmentContext } from './main.js'
13
13
import { base64Decode } from './util.js'
14
14
@@ -271,9 +271,10 @@ describe('get', () => {
271
271
} )
272
272
273
273
test ( 'Throws when an edge URL returns a non-200 status code' , async ( ) => {
274
+ const errorDetails = 'Missing authorization header'
274
275
const mockStore = new MockFetch ( ) . get ( {
275
276
headers : { authorization : `Bearer ${ edgeToken } ` } ,
276
- response : new Response ( null , { status : 401 } ) ,
277
+ response : new Response ( null , { headers : { [ NF_ERROR ] : errorDetails } , status : 401 } ) ,
277
278
url : `${ edgeURL } /${ siteID } /site:production/${ key } ` ,
278
279
} )
279
280
@@ -287,7 +288,7 @@ describe('get', () => {
287
288
} )
288
289
289
290
await expect ( async ( ) => await blobs . get ( key ) ) . rejects . toThrowError (
290
- `Netlify Blobs has generated an internal error: 401 response ` ,
291
+ `Netlify Blobs has generated an internal error: ${ errorDetails } ` ,
291
292
)
292
293
293
294
expect ( mockStore . fulfilled ) . toBeTruthy ( )
0 commit comments