diff --git a/src/main/java/com/example/daemawiki/domain/content/service/AddContentTable.java b/src/main/java/com/example/daemawiki/domain/content/service/AddContentTable.java index 395017a6..027d5639 100644 --- a/src/main/java/com/example/daemawiki/domain/content/service/AddContentTable.java +++ b/src/main/java/com/example/daemawiki/domain/content/service/AddContentTable.java @@ -8,6 +8,7 @@ import com.example.daemawiki.domain.revision.dto.request.SaveRevisionHistoryRequest; import com.example.daemawiki.domain.revision.model.type.RevisionType; import com.example.daemawiki.global.exception.h400.VersionMismatchException; +import com.example.daemawiki.global.exception.h500.ExecuteFailedException; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @@ -64,7 +65,8 @@ public Mono execute(AddContentRequest request) { .type(RevisionType.UPDATE) .documentId(request.documentId()) .title(document.getTitle()) - .build())); + .build())) + .onErrorMap(e -> e instanceof VersionMismatchException ? e : ExecuteFailedException.EXCEPTION); } } diff --git a/src/main/java/com/example/daemawiki/domain/info/service/UpdateInfo.java b/src/main/java/com/example/daemawiki/domain/info/service/UpdateInfo.java index f42b701c..de60185d 100644 --- a/src/main/java/com/example/daemawiki/domain/info/service/UpdateInfo.java +++ b/src/main/java/com/example/daemawiki/domain/info/service/UpdateInfo.java @@ -7,6 +7,7 @@ import com.example.daemawiki.domain.revision.dto.request.SaveRevisionHistoryRequest; import com.example.daemawiki.domain.revision.model.type.RevisionType; import com.example.daemawiki.global.exception.h400.VersionMismatchException; +import com.example.daemawiki.global.exception.h500.ExecuteFailedException; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @@ -36,7 +37,8 @@ public Mono execute(UpdateInfoRequest request) { .type(RevisionType.UPDATE) .documentId(request.documentId()) .title(document.getTitle()) - .build())); + .build())) + .onErrorMap(e -> e instanceof VersionMismatchException ? e : ExecuteFailedException.EXCEPTION); } }