Reamer commented on code in PR #4789:
URL: https://github.com/apache/zeppelin/pull/4789#discussion_r1714748649
##########
zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java:
##########
@@ -134,10 +137,23 @@ public Note get(String noteId, String notePath,
AuthenticationInfo subject)
NameScope.DESCENDENT);
String json = IOUtils.toString(noteFile.getContent().getInputStream(),
conf.getString(ConfVars.ZEPPELIN_ENCODING));
- Note note = noteParser.fromJson(noteId, json);
- // setPath here just for testing, because actually NoteManager will setPath
- note.setPath(notePath);
- return note;
+
+ try {
+ Note note = noteParser.fromJson(noteId, json);
+ // setPath here just for testing, because actually NoteManager will
setPath
+ note.setPath(notePath);
+ return note;
+ } catch (CorruptedNoteException e) {
+ String errorMessage = String.format(
Review Comment:
Please do not use newlines in short messages. If the error is logged, this
makes parsing unnecessarily difficult.
##########
zeppelin-web/src/components/websocket/websocket-event.factory.js:
##########
@@ -172,7 +172,7 @@ function WebsocketEventFactory($rootScope, $websocket,
$location, baseUrlSrv, sa
closeByBackdrop: false,
closeByKeyboard: false,
title: 'Details',
- message: _.escape(data.info.toString()),
+ message: _.escape(data.info.toString()).replace(/\n/g, '<br>'),
Review Comment:
I don't know what message is being displayed here. If it is the
`CorruptedNoteException`, then I think it is unnecessary.
See comment below on the multi-line error message.
##########
zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java:
##########
@@ -45,22 +45,21 @@ class VFSNotebookRepoTest {
private ZeppelinConfiguration zConf;
private NoteParser noteParser;
private VFSNotebookRepo notebookRepo;
- private File notebookDir;
Review Comment:
Yes, I agree
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]