aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-11-12 15:43:22 +0300
committerGravatar Vitaly Takmazov2021-11-12 15:43:22 +0300
commit90884d525456e4644723e416424f1581661b2aa8 (patch)
tree3bbdaaedca4fda87db6cbbd22416471922beac68 /src/main/java/com/juick/www/api
parentef1009fc95f7ef56c2b1248f7fd7cd65f582d14a (diff)
Throw correct exception from mark_read API endpoint
Diffstat (limited to 'src/main/java/com/juick/www/api')
-rw-r--r--src/main/java/com/juick/www/api/Messages.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java
index 9608813d..a782f680 100644
--- a/src/main/java/com/juick/www/api/Messages.java
+++ b/src/main/java/com/juick/www/api/Messages.java
@@ -192,7 +192,7 @@ public class Messages {
throws IOException {
if (!visitor.isAnonymous()) {
messagesService.setLastReadComment(visitor, mid, rid);
- Message msg = messagesService.getMessage(mid).orElseThrow(IllegalStateException::new);
+ Message msg = messagesService.getMessage(mid).orElseThrow(HttpNotFoundException::new);
userService.updateLastSeen(visitor);
applicationEventPublisher.publishEvent(new SystemEvent(this, SystemActivity.read(visitor, msg)));
return IOUtils.toByteArray(invisiblePixel.getInputStream());