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:
us...@infra.apache.org


Reply via email to