소스 검색

refactor error

yohei0125 4 년 전
부모
커밋
95afebaf12
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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> {
     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