wingbot 3.74.4 → 3.74.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.
package/package.json
CHANGED
|
@@ -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
|
|
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
|
}
|