You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnreject(newError(`Server answered with HTTP ${statusCode} when performing the request to ${url}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`));
45
-
});
29
+
letresponse;
30
+
try{
31
+
response=awaitglobalThis.fetch(input,{
32
+
...init,
33
+
dispatcher: agent,
34
+
});
35
+
}catch(error){
36
+
thrownewError(
37
+
`Error when performing the request to ${input}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`,
38
+
{cause: error},
39
+
);
40
+
}
46
41
47
-
request.on(`error`,err=>{
48
-
reject(newError(`Error when performing the request to ${url}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`));
49
-
});
50
-
};
42
+
if(!response.ok){
43
+
awaitresponse.arrayBuffer();
44
+
thrownewError(
45
+
`Server answered with HTTP ${response.status} when performing the request to ${input}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`,
0 commit comments