mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
fix(ops/net): fix panic in op_dns_resolve (#9187)
This commit is contained in:
parent
ffb4b32e92
commit
0a159bea15
3 changed files with 9 additions and 1 deletions
|
@ -34,3 +34,9 @@ console.log(JSON.stringify(srv));
|
|||
|
||||
console.log("TXT");
|
||||
console.log(JSON.stringify(txt));
|
||||
|
||||
try {
|
||||
await Deno.resolveDns("not-found-example.com", "A", nameServer);
|
||||
} catch (e) {
|
||||
console.log("Error thrown for not-found-example.com");
|
||||
}
|
||||
|
|
|
@ -14,3 +14,4 @@ SRV
|
|||
[{"priority":0,"weight":100,"port":1234,"target":"srv.com."}]
|
||||
TXT
|
||||
[["foo","bar"]]
|
||||
Error thrown for not-found-example.com
|
||||
|
|
|
@ -629,7 +629,8 @@ async fn op_dns_resolve(
|
|||
|
||||
let results: Vec<DnsReturnRecord> = resolver
|
||||
.lookup(query, record_type, Default::default())
|
||||
.await?
|
||||
.await
|
||||
.map_err(|e| generic_error(format!("{}", e)))?
|
||||
.iter()
|
||||
.filter_map(rdata_to_return_record(record_type))
|
||||
.collect();
|
||||
|
|
Loading…
Reference in a new issue