diff options
author | Vitaly Takmazov | 2018-11-01 13:29:29 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-11-01 13:29:29 +0300 |
commit | 2b9d2478833a060df76c855e78c46e33c032db49 (patch) | |
tree | a516cb597704529cf1de623eb807d219a5510d49 /juick-server/src/main/java/com/juick/server/SignatureManager.java | |
parent | 0dc2727e0633a4b865d814c7ab8450e3c815e511 (diff) |
ActivityPub: fix 410 error handler
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/SignatureManager.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/SignatureManager.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/juick-server/src/main/java/com/juick/server/SignatureManager.java b/juick-server/src/main/java/com/juick/server/SignatureManager.java index d43efd4a..927a62a7 100644 --- a/juick-server/src/main/java/com/juick/server/SignatureManager.java +++ b/juick-server/src/main/java/com/juick/server/SignatureManager.java @@ -89,15 +89,11 @@ public class SignatureManager { return false; } public Optional<Context> getContext(URI contextUri) { - try { - return Optional.of(apClient.getForEntity(contextUri, Context.class).getBody()); - } catch (HttpClientErrorException e) { + Context context = apClient.getForEntity(contextUri, Context.class).getBody(); + if (context == null) { logger.warn("Cannot identify {}", contextUri); - if (e.getStatusCode().equals(HttpStatus.GONE)) { - logger.warn("Server report {} is gone, deleting", contextUri); - applicationEventPublisher.publishEvent(new DeleteUserEvent(this, contextUri.toASCIIString())); - } + return Optional.empty(); } - return Optional.empty(); + return Optional.of(context); } } |