From 37725dfd9cd9b1a67d81557583f7c89321abe387 Mon Sep 17 00:00:00 2001 From: Vincent Cloutier Date: Fri, 17 Mar 2023 16:03:44 -0400 Subject: [PATCH] catch an exception --- src/BirdsiteLive.Domain/UserService.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/BirdsiteLive.Domain/UserService.cs b/src/BirdsiteLive.Domain/UserService.cs index 8131c7e..62a72b6 100644 --- a/src/BirdsiteLive.Domain/UserService.cs +++ b/src/BirdsiteLive.Domain/UserService.cs @@ -196,9 +196,16 @@ namespace BirdsiteLive.Domain apObject = activity.apObject } }; - var result = await _activityPubService.PostDataAsync(acceptFollow, followerHost, activity.apObject); - return result == HttpStatusCode.Accepted || - result == HttpStatusCode.OK; //TODO: revamp this for better error handling + try + { + var result = await _activityPubService.PostDataAsync(acceptFollow, followerHost, activity.apObject); + return result == HttpStatusCode.Accepted || + result == HttpStatusCode.OK; + } + catch (Exception e) + { + return false; + } } public async Task SendRejectFollowAsync(ActivityFollow activity, string followerHost)