Browse Source

refactor error

yohei0125 4 years ago
parent
commit
95afebaf12
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/app/src/server/service/page.ts

+ 3 - 1
packages/app/src/server/service/page.ts

@@ -564,7 +564,9 @@ class PageService {
 
 
   async restartPageRenameOperation(pageId: ObjectIdLike): Promise<void> {
   async restartPageRenameOperation(pageId: ObjectIdLike): Promise<void> {
     const pageOp = await PageOperation.findOne({ 'page.id': pageId, actionType: PageActionType.Rename, isFailure: true });
     const pageOp = await PageOperation.findOne({ 'page.id': pageId, actionType: PageActionType.Rename, isFailure: true });
-    if (pageOp == null || pageOp.toPath == null) throw Error('PageRenameOperation is not executable');
+    if (pageOp == null || pageOp.toPath == null) {
+      throw Error('PageRenameOperation cannot be restarted as PageOperation to be processed is not found');
+    }
 
 
     pageOp.actionStage = PageActionStage.Main; // to restart from the beginning
     pageOp.actionStage = PageActionStage.Main; // to restart from the beginning