@knowlearning/agents 0.9.100 → 0.9.102
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/agents/generic/index.js
CHANGED
|
@@ -61,7 +61,7 @@ export default function Agent({ Connection, domain, token, uuid, fetch, applyPat
|
|
|
61
61
|
|
|
62
62
|
function debug() { mode = 'debug' }
|
|
63
63
|
|
|
64
|
-
function log() {
|
|
64
|
+
function log() { passedLog(...arguments) }
|
|
65
65
|
|
|
66
66
|
function create({ id=uuid(), active_type, active, name }) {
|
|
67
67
|
if (!active_type) active_type = 'application/json'
|
|
@@ -158,7 +158,12 @@ export default function messageQueue({ token, domain, Connection, watchers, stat
|
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
160
160
|
if (DOMAIN_MESSAGES[message.type]) {
|
|
161
|
-
|
|
161
|
+
try {
|
|
162
|
+
handleDomainMessage && handleDomainMessage(message, trigger)
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
log('ERROR HANDLING DOMAIN MESSAGE', message)
|
|
166
|
+
}
|
|
162
167
|
}
|
|
163
168
|
else if (message.si !== undefined) {
|
|
164
169
|
if (responses[message.si]) {
|