【发布时间】:2020-05-13 10:03:18
【问题描述】:
在 Wraupup 聊天任务之后,当我从 Twilio Chat API 添加消息时,我收到“Uncaught (in promise) t: Error while setting LastConsumedMessageIndex”错误消息。如果代理在单击 Wraupup 任务按钮后立即单击 Twilio Flex 中的完成任务,则此错误消息将显示在浏览器控制台中。
我发现此错误是由 Twilio JS SDK 中的 sessionerror.js 文件生成的。我无法更改该文件的源代码。如何从我的自定义代码中覆盖它?
这是我在 sessionerror.js 文件中找到的代码:
var SessionError = function (_extendableBuiltin2) {
(0, _inherits3.default)(SessionError, _extendableBuiltin2);
function SessionError(message, code) {
(0, _classCallCheck3.default)(this, SessionError);
var _this = (0, _possibleConstructorReturn3.default)(this, (SessionError.__proto__ || (0, _getPrototypeOf2.default)(SessionError)).call(this));
_this.name = _this.constructor.name;
_this.message = message;
_this.code = code;
if (Error.captureStackTrace) {
Error.captureStackTrace(_this, _this.constructor);
} else {
_this.stack = new Error().stack;
}
return _this;
}
return SessionError;
}(_extendableBuiltin(Error));
exports.SessionError = SessionError;
我怎样才能覆盖它?
【问题讨论】:
标签: javascript reactjs error-handling twilio twilio-programmable-chat