wingbot 3.74.4 → 3.74.5

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,7 +1,8 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(npx mocha:*)"
4
+ "Bash(npx mocha:*)",
5
+ "Bash(npx tsc *)"
5
6
  ]
6
7
  }
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.74.4",
3
+ "version": "3.74.5",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -81,7 +81,14 @@ class WingbotModel extends CachedModel {
81
81
  throw new Error(`Failed to load Phrases: ${res.statusText}`);
82
82
  }
83
83
 
84
- const { phrases = [] } = await res.json();
84
+ const responseText = await res.text();
85
+ let response;
86
+ try {
87
+ response = JSON.parse(responseText);
88
+ } catch (e) {
89
+ throw new Error(`[${res.status}] Invalid JSON response: ${responseText}`);
90
+ }
91
+ const { phrases = [] } = response;
85
92
 
86
93
  return { phrases: new Map(phrases) };
87
94
  }