cisco-perfmon 1.3.0 → 1.3.1

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.
Files changed (2) hide show
  1. package/main.js +14 -2
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -205,8 +205,20 @@ class perfMonService {
205
205
  reject(promiseResults);
206
206
  }
207
207
  } else {
208
- promiseResults.Results = { response: "empty" };
209
- resolve(promiseResults);
208
+ // Error checking. If the response contains a fault, we return the fault.
209
+ if (keyExists(output, "Fault")) {
210
+ if (output.Body.Fault.faultcode.includes("RateControl")) {
211
+ promiseResults.Results = { faultcode: "RateControl", faultstring: output.Body.Fault.faultstring };
212
+ } else if (output.Body.Fault.faultcode.includes("generalException")) {
213
+ promiseResults.Results = { faultcode: "generalException", faultstring: output.Body.Fault.faultstring };
214
+ } else {
215
+ promiseResults.Results = { faultcode: output.Body.Fault.faultcode, faultstring: output.Body.Fault.faultstring };
216
+ }
217
+ resolve(promiseResults);
218
+ } else {
219
+ // Error unknown. Return the response status instead.
220
+ reject(response.status);
221
+ }
210
222
  }
211
223
  } catch (e) {
212
224
  promiseResults.Results = e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cisco-perfmon",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A library to pull Perfmon data from Cisco VOS applications via SOAP",
5
5
  "main": "main.js",
6
6
  "scripts": {