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
This commit is contained in:
Lilia 2017-09-26 01:42:56 +02:00 committed by Scott Nonnenberg
parent 314b29e426
commit 9f82a37d8b
2 changed files with 12 additions and 0 deletions

View file

@ -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);

View file

@ -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);