Log call messages instead of throwing error (#1504)

Rather than throw an error, just log call messages and drop them. This way we
distinguish them from incorrectly encoded content messages or new types of
messages we don't support yet, and don't insert unnecessary red flags and
stacktraces in debug logs.

// FREEBIE
pull/749/head
Lilia 8 years ago committed by Scott Nonnenberg
parent 314b29e426
commit 9f82a37d8b

@ -38837,11 +38837,17 @@ MessageReceiver.prototype.extend({
return this.handleDataMessage(envelope, content.dataMessage);
} else if (content.nullMessage) {
return this.handleNullMessage(envelope, content.nullMessage);
} else if (content.callMessage) {
return this.handleCallMessage(envelope, content.callMessage);
} else {
this.removeFromCache(envelope);
throw new Error('Unsupported content message');
}
},
handleCallMessage: function(envelope, nullMessage) {
console.log('call message from', this.getEnvelopeId(envelope));
this.removeFromCache(envelope);
},
handleNullMessage: function(envelope, nullMessage) {
console.log('null message from', this.getEnvelopeId(envelope));
this.removeFromCache(envelope);

@ -483,11 +483,17 @@ MessageReceiver.prototype.extend({
return this.handleDataMessage(envelope, content.dataMessage);
} else if (content.nullMessage) {
return this.handleNullMessage(envelope, content.nullMessage);
} else if (content.callMessage) {
return this.handleCallMessage(envelope, content.callMessage);
} else {
this.removeFromCache(envelope);
throw new Error('Unsupported content message');
}
},
handleCallMessage: function(envelope, nullMessage) {
console.log('call message from', this.getEnvelopeId(envelope));
this.removeFromCache(envelope);
},
handleNullMessage: function(envelope, nullMessage) {
console.log('null message from', this.getEnvelopeId(envelope));
this.removeFromCache(envelope);

Loading…
Cancel
Save