Show information to the user when there are errors with related to

permission on running paragraphs.
This commit is contained in:
Kavin 2016-09-06 17:51:26 +05:30
parent 2dc26f27be
commit 9f7cf678ea
3 changed files with 23 additions and 1 deletions

View file

@ -258,6 +258,12 @@ public class NotebookServer extends WebSocketServlet implements
}
} catch (Exception e) {
LOG.error("Can't handle message", e);
try {
conn.send(serializeMessage(new Message(OP.ERROR_INFO).put("info",
"Oops! Something went wrong. Please check with your administrator.")));
} catch (IOException e1) {
LOG.error("Can't handle message", e);
}
}
}

View file

@ -117,6 +117,21 @@ angular.module('zeppelinWebApp').factory('websocketEvents',
$rootScope.$broadcast('noteRevision', data);
} else if (op === 'INTERPRETER_BINDINGS') {
$rootScope.$broadcast('interpreterBindings', data);
} else if (op === 'ERROR_INFO') {
BootstrapDialog.show({
closable: false,
closeByBackdrop: false,
closeByKeyboard: false,
title: 'Details',
message: data.info.toString(),
buttons: [{
// close all the dialogs when there are error on running all paragraphs
label: 'Close',
action: function() {
BootstrapDialog.closeAll();
}
}]
});
}
});

View file

@ -139,7 +139,8 @@ public class Message {
SAVE_INTERPRETER_BINDINGS, // [c-s] save interpreter bindings
// @param noteID
// @param selectedSettingIds
INTERPRETER_BINDINGS // [s-c] interpreter bindings
INTERPRETER_BINDINGS, // [s-c] interpreter bindings
ERROR_INFO // [s-c] error information to be sent
}
public OP op;