Chromium Code Reviews| Index: remoting/webapp/crd/js/host_daemon_facade.js |
| diff --git a/remoting/webapp/crd/js/host_daemon_facade.js b/remoting/webapp/crd/js/host_daemon_facade.js |
| index 544abd39683d617c787e344caa5695f963b32a6a..cea917212dc8d0f342fc395b8d0a7b7b0260cf87 100644 |
| --- a/remoting/webapp/crd/js/host_daemon_facade.js |
| +++ b/remoting/webapp/crd/js/host_daemon_facade.js |
| @@ -196,7 +196,13 @@ remoting.HostDaemonFacade.prototype.onIncomingMessage_ = function(message) { |
| try { |
| var type = base.getStringAttr(message, 'type'); |
| if (type != reply.type) { |
| - throw 'Expected reply type: ' + reply.type + ', got: ' + type; |
| + throw new Error('Expected reply type: ' + reply.type + ', got: ' + type); |
| + } |
| + var error_message = base.getStringAttr(message, 'error_message', ''); |
| + if (error_message) { |
| + var error_location = base.getStringAttr(message, 'error_location', |
| + '<unknown>') |
| + console.error(error_message + ' at ' + error_location); |
| } |
| reply.deferred.resolve(message); |
|
Sergey Ulanov
2015/08/06 22:40:57
should we call reject() in case there was an error
Jamie
2015/08/06 23:06:17
I don't think so. The contract here is that the ca
|
| } catch (/** @type {*} */ e) { |