wingbot 3.53.0 → 3.53.1-alpha.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.53.0",
3
+ "version": "3.53.1-alpha.1",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -192,6 +192,12 @@ function selectTranslation (resolverId, params, texts, data) {
192
192
  const key = `_R_${resolverId}`;
193
193
  let { lang, [key]: seqState } = data;
194
194
 
195
+ if (texts.length === 0) {
196
+ console.log('MSG0-P', params); // eslint-disable-line no-console
197
+ console.log('MSG0-D', { resolverId, texts }); // eslint-disable-line no-console
198
+ throw new Error(`Resolver ${resolverId} failed ${JSON.stringify(params.text).replace(/"([^"]+)":/g, '$1:')}`);
199
+ }
200
+
195
201
  if (texts.length === 1) {
196
202
  return [
197
203
  renderMessageText(texts[0].t, data),
@@ -220,6 +226,11 @@ function selectTranslation (resolverId, params, texts, data) {
220
226
  const index = data._expandRandomTexts
221
227
  ? 1
222
228
  : Math.floor(Math.random() * texts.length);
229
+ if (!texts[index]) {
230
+ console.log('MSG-P', params); // eslint-disable-line no-console
231
+ console.log('MSG-D', { resolverId, texts }); // eslint-disable-line no-console
232
+ throw new Error(`Resolver ${resolverId} failed ${JSON.stringify(params.text).replace(/"([^"]+)":/g, '$1:')}`);
233
+ }
223
234
  return [
224
235
  renderMessageText(texts[index].t, data),
225
236
  seqState