Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit d07a67c

Browse files
committedJan 23, 2018
refactor(uri-parser): simplify error checks for ENODATA errors
NODE-1295
1 parent 6aa391a commit d07a67c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎lib/uri_parser.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ function parseSrvConnectionString(uri, options, callback) {
8585
}
8686

8787
dns.resolveTxt(result.host, (err, record) => {
88-
if (err && err.code !== 'ENODATA') return callback(err);
89-
if (err && err.code === 'ENODATA') record = null;
88+
if (err) {
89+
if (err.code !== 'ENODATA') {
90+
return callback(err);
91+
}
92+
record = null;
93+
}
9094

9195
if (record) {
9296
if (record.length > 1) {

0 commit comments

Comments
 (0)
This repository has been archived.