From 6bb0a8e7b34c7ca6e7305604089173d89c53f16d Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 11 Jan 2019 13:56:10 -0800 Subject: [PATCH] Changed error handling --- modules/smbios.js | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/modules/smbios.js b/modules/smbios.js index 61153a5..0770e4f 100644 --- a/modules/smbios.js +++ b/modules/smbios.js @@ -143,15 +143,45 @@ function SMBiosTables() }); return; } - throw (process.platform + ' not supported'); + if (callback) { callback.apply(this, [null]); return; } else { return (null); } }; this.parse = function parse(data) { var r = {}; - r.processorInfo = this.processorInfo(data); - r.memoryInfo = this.memoryInfo(data); - r.systemInfo = this.systemInfo(data); - r.systemSlots = this.systemInfo(data); - r.amtInfo = this.amtInfo(data); + try + { + r.processorInfo = this.processorInfo(data); + } + catch(e) + { + } + try + { + r.memoryInfo = this.memoryInfo(data); + } + catch(e) + { + } + try + { + r.systemInfo = this.systemInfo(data); + } + catch(e) + { + } + try + { + r.systemSlots = this.systemInfo(data); + } + catch(e) + { + } + try + { + r.amtInfo = this.amtInfo(data); + } + catch(e) + { + } return r; } this.processorInfo = function processorInfo(data) {