Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions static/js/directives/screenshare.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,21 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
$scope.stopScreenshare();
}
}, function(err) {
console.log("Screen sharing request returned error", err);
alertify.dialog.alert(translation._("Failed to start screen sharing (%s).", err));
var errMsg = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not define as empty string and provide reference where this error handling comes from? When does err.detail ever exist?

var errCode = '';
if (err && err.detail) {
errMsg = err.detail;
errCode = err.errorCode;
} else {
errMsg = err;
}
console.log("Screen sharing request returned error", errMsg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please log full err.

// Do not display error dialog when user cancelled action of
// chrome extension installation
// https://developer.chrome.com/extensions/webstore#type-ErrorCode
if (errCode !== 'userCancelled') {
alertify.dialog.alert(translation._("Failed to start screen sharing (%s).", errMsg));
}
$scope.stopScreenshare();
});

Expand Down