mirror of
https://github.com/NicolasConstant/BirdsiteLive
synced 2025-06-05 21:49:16 +02:00
handle exception in sharedInbox
This commit is contained in:
@@ -46,7 +46,7 @@ namespace BirdsiteLive.Domain
|
||||
var result = await httpClient.GetAsync(objectId);
|
||||
|
||||
if (result.StatusCode == HttpStatusCode.Gone)
|
||||
throw new UserIsGoneException();
|
||||
throw new FollowerIsGoneException();
|
||||
|
||||
result.EnsureSuccessStatusCode();
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace BirdsiteLive.Domain
|
||||
{
|
||||
public class UserIsGoneException : Exception
|
||||
public class FollowerIsGoneException : Exception
|
||||
{
|
||||
}
|
||||
}
|
@@ -30,6 +30,8 @@ namespace BirdsiteLive.Controllers
|
||||
[Route("/inbox")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> Inbox()
|
||||
{
|
||||
try
|
||||
{
|
||||
var r = Request;
|
||||
using (var reader = new StreamReader(Request.Body))
|
||||
@@ -53,6 +55,8 @@ namespace BirdsiteLive.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (FollowerIsGoneException) { } //TODO: check if user in DB
|
||||
|
||||
return Accepted();
|
||||
}
|
||||
|
@@ -214,7 +214,7 @@ namespace BirdsiteLive.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (UserIsGoneException)
|
||||
catch (FollowerIsGoneException) //TODO: check if user in DB
|
||||
{
|
||||
return Accepted();
|
||||
}
|
||||
|
Reference in New Issue
Block a user