interceptors.responseError does not raise networking errors
When the interceptors.responseError interceptor is used, this does not raise network errors, returning the request as if it had been successful.
Reproducible By
import { Pool } from "undici";
const URL = "https://foo.bar.ciao.com"; // <- URL does not exist
async function main() {
const client = new Pool(URL);
try {
const response = await client
.compose(interceptors.responseError({ throwOnError: true }))
.request({ method: "GET", path: "/" });
console.log(response.statusCode);
} catch (e) { // <- not raised
console.log(e);
}
}
if (require.main === module) {
void main();
}
Expected Behavior
request raises an error Error: getaddrinfo ENOTFOUND. This is raised when we don't use interceptors.responseError
Environment
- node:
20.18
- undici:
7.1.0
interceptors.responseErrordoes not raise networking errorsWhen the
interceptors.responseErrorinterceptor is used, this does not raise network errors, returning the request as if it had been successful.Reproducible By
Expected Behavior
requestraises an errorError: getaddrinfo ENOTFOUND. This is raised when we don't useinterceptors.responseErrorEnvironment
20.187.1.0