Give better exception feedback in message handler.

This commit is contained in:
Joel Martin 2010-06-04 13:51:21 -05:00
parent 30298582d0
commit 14355cb212
1 changed files with 7 additions and 1 deletions

8
vnc.js
View File

@ -956,7 +956,13 @@ recv_message: function(e) {
RFB.handle_message();
}
} catch (exc) {
console.log("recv_message, caught exception: " + exc);
if (typeof exc.stack !== 'undefined') {
console.log("recv_message, caught exception: " + exc.stack);
} else if (typeof exc.description !== 'undefined') {
console.log("recv_message, caught exception: " + exc.description);
} else {
console.log("recv_message, caught exception:" + exc);
}
if (typeof exc.name !== 'undefined') {
RFB.updateState('failed', exc.name + ": " + exc.message);
} else {