You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/06/15 14:37:57 UTC

[GitHub] [zeppelin] zjffdu commented on a change in pull request #4134: [ZEPPELIN-5398] fix ZEPPELIN-5398, make corrupted notes deletable

zjffdu commented on a change in pull request #4134:
URL: https://github.com/apache/zeppelin/pull/4134#discussion_r651857706



##########
File path: zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
##########
@@ -1012,7 +1012,28 @@ public void updatePersonalizedMode(String noteId,
   public void moveNoteToTrash(String noteId,
                               ServiceContext context,
                               ServiceCallback<Note> callback) throws IOException {
-    Note note = notebook.getNote(noteId);
+    Note note = null;
+    try {
+       note = notebook.getNote(noteId);
+    } catch (Exception e) {
+        if ((e.getMessage() != null) && (e.getMessage().contains("Fail to parse note json"))) {

Review comment:
       It is better to use specific kind of Exception to represent the corrupted note case. 




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org