core-3nweb-client-lib 0.30.5 → 0.30.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright (C) 2015 - 2017, 2020 - 2021 3NSoft Inc.
|
|
3
|
+
Copyright (C) 2015 - 2017, 2020 - 2021, 2024 3NSoft Inc.
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify it under
|
|
6
6
|
the terms of the GNU General Public License as published by the Free Software
|
|
@@ -142,12 +142,13 @@ function checkAndPrepareURL(value) {
|
|
|
142
142
|
// XXX insert some value sanity check
|
|
143
143
|
return 'https://' + value;
|
|
144
144
|
}
|
|
145
|
-
function domainNotFoundExc(address) {
|
|
145
|
+
function domainNotFoundExc(address, cause) {
|
|
146
146
|
const exc = {
|
|
147
147
|
runtimeException: true,
|
|
148
148
|
type: 'service-locating',
|
|
149
149
|
address,
|
|
150
|
-
domainNotFound: true
|
|
150
|
+
domainNotFound: true,
|
|
151
|
+
cause
|
|
151
152
|
};
|
|
152
153
|
return exc;
|
|
153
154
|
}
|
|
@@ -242,11 +243,12 @@ function makeServiceLocator(resolver) {
|
|
|
242
243
|
return url;
|
|
243
244
|
}
|
|
244
245
|
catch (err) {
|
|
245
|
-
|
|
246
|
+
const { code, hostname, message } = err;
|
|
247
|
+
if (code === DNS_ERR_CODE.NODATA) {
|
|
246
248
|
throw noServiceRecordExc(address);
|
|
247
249
|
}
|
|
248
|
-
else if (
|
|
249
|
-
throw domainNotFoundExc(address);
|
|
250
|
+
else if (hostname) {
|
|
251
|
+
throw domainNotFoundExc(address, { code, hostname, message });
|
|
250
252
|
}
|
|
251
253
|
else {
|
|
252
254
|
throw err;
|