networkInterfaces() catch errors
This commit is contained in:
parent
2bc1ee6621
commit
4f60a4c947
@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 4.34.6 | 2020-01-12 | `networkInterfaces()` catch errors |
|
||||||
| 4.34.5 | 2020-01-07 | `networkInterfaceDefault()` fixed CMD popup (windows) |
|
| 4.34.5 | 2020-01-07 | `networkInterfaceDefault()` fixed CMD popup (windows) |
|
||||||
| 4.34.4 | 2020-01-06 | `system()` fixed vitrual catch error |
|
| 4.34.4 | 2020-01-06 | `system()` fixed vitrual catch error |
|
||||||
| 4.34.3 | 2020-01-06 | `graphics()` fixed non nvidia-smi controllers (win) |
|
| 4.34.3 | 2020-01-06 | `graphics()` fixed non nvidia-smi controllers (win) |
|
||||||
|
|||||||
@ -83,6 +83,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">4.34.6</th>
|
||||||
|
<td>2020-01-12</td>
|
||||||
|
<td><span class="code">networkInterfaces()</span> catch errors</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">4.34.5</th>
|
<th scope="row">4.34.5</th>
|
||||||
<td>2020-01-07</td>
|
<td>2020-01-07</td>
|
||||||
|
|||||||
@ -169,7 +169,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span></div>
|
<div class="subtitle"><span id="typed"></span></div>
|
||||||
<div class="version">Current Version: <span id="version">4.34.5</span></div>
|
<div class="version">Current Version: <span id="version">4.34.6</span></div>
|
||||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
@ -208,7 +208,7 @@
|
|||||||
<div class="title">Downloads last month</div>
|
<div class="title">Downloads last month</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||||
<div class="numbers">366</div>
|
<div class="numbers">367</div>
|
||||||
<div class="title">Dependents</div>
|
<div class="title">Dependents</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -685,12 +685,13 @@ function networkInterfaces(callback, rescan = true) {
|
|||||||
}
|
}
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let ifaces = os.networkInterfaces();
|
|
||||||
|
|
||||||
let result = [];
|
let result = [];
|
||||||
let nics = [];
|
let nics = [];
|
||||||
let dnsSuffixes = [];
|
let dnsSuffixes = [];
|
||||||
let nics8021xInfo = [];
|
let nics8021xInfo = [];
|
||||||
|
try {
|
||||||
|
let ifaces = os.networkInterfaces();
|
||||||
|
|
||||||
// seperate handling in OSX
|
// seperate handling in OSX
|
||||||
if (_darwin || _freebsd || _openbsd || _netbsd) {
|
if (_darwin || _freebsd || _openbsd || _netbsd) {
|
||||||
nics = getDarwinNics();
|
nics = getDarwinNics();
|
||||||
@ -917,6 +918,10 @@ function networkInterfaces(callback, rescan = true) {
|
|||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
if (callback) { callback(result); }
|
||||||
|
resolve(result);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user