Skip to content

Commit 9f7cf67

Browse files
author
Kavin
committed
Show information to the user when there are errors with related to
permission on running paragraphs.
1 parent 2dc26f2 commit 9f7cf67

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ public void onMessage(NotebookSocket conn, String msg) {
258258
}
259259
} catch (Exception e) {
260260
LOG.error("Can't handle message", e);
261+
try {
262+
conn.send(serializeMessage(new Message(OP.ERROR_INFO).put("info",
263+
"Oops! Something went wrong. Please check with your administrator.")));
264+
} catch (IOException e1) {
265+
LOG.error("Can't handle message", e);
266+
}
261267
}
262268
}
263269

zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,21 @@ angular.module('zeppelinWebApp').factory('websocketEvents',
117117
$rootScope.$broadcast('noteRevision', data);
118118
} else if (op === 'INTERPRETER_BINDINGS') {
119119
$rootScope.$broadcast('interpreterBindings', data);
120+
} else if (op === 'ERROR_INFO') {
121+
BootstrapDialog.show({
122+
closable: false,
123+
closeByBackdrop: false,
124+
closeByKeyboard: false,
125+
title: 'Details',
126+
message: data.info.toString(),
127+
buttons: [{
128+
// close all the dialogs when there are error on running all paragraphs
129+
label: 'Close',
130+
action: function() {
131+
BootstrapDialog.closeAll();
132+
}
133+
}]
134+
});
120135
}
121136
});
122137

zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ public static enum OP {
139139
SAVE_INTERPRETER_BINDINGS, // [c-s] save interpreter bindings
140140
// @param noteID
141141
// @param selectedSettingIds
142-
INTERPRETER_BINDINGS // [s-c] interpreter bindings
142+
INTERPRETER_BINDINGS, // [s-c] interpreter bindings
143+
ERROR_INFO // [s-c] error information to be sent
143144
}
144145

145146
public OP op;

0 commit comments

Comments
 (0)