diff options
author | Vitaly Takmazov | 2021-11-12 15:43:22 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-11-12 15:43:22 +0300 |
commit | 90884d525456e4644723e416424f1581661b2aa8 (patch) | |
tree | 3bbdaaedca4fda87db6cbbd22416471922beac68 /src/main/java/com/juick/www/api | |
parent | ef1009fc95f7ef56c2b1248f7fd7cd65f582d14a (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.java | 2 |
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()); |