mirror of https://github.com/grpc/grpc-node.git
reject lookup when all resolutions reject
This commit is contained in:
parent
2a9f8f4c40
commit
3aaf0c6e52
|
@ -302,6 +302,10 @@ class DnsResolver implements Resolver {
|
||||||
this.independentResolver.resolve6(hostname),
|
this.independentResolver.resolve6(hostname),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (records.every(result => result.status === 'rejected')) {
|
||||||
|
throw new Error((records[0] as PromiseRejectedResult).reason);
|
||||||
|
}
|
||||||
|
|
||||||
return records
|
return records
|
||||||
.reduce<string[]>((acc, result) => {
|
.reduce<string[]>((acc, result) => {
|
||||||
return result.status === 'fulfilled'
|
return result.status === 'fulfilled'
|
||||||
|
|
Loading…
Reference in New Issue