diff --git a/Iceshrimp.Backend/Core/Queues/InboxQueue.cs b/Iceshrimp.Backend/Core/Queues/InboxQueue.cs index e6ee5f8c..f7f7e148 100644 --- a/Iceshrimp.Backend/Core/Queues/InboxQueue.cs +++ b/Iceshrimp.Backend/Core/Queues/InboxQueue.cs @@ -1,6 +1,7 @@ using Iceshrimp.Backend.Core.Federation.ActivityPub; using Iceshrimp.Backend.Core.Federation.ActivityStreams; using Iceshrimp.Backend.Core.Federation.ActivityStreams.Types; +using Iceshrimp.Backend.Core.Middleware; using Iceshrimp.Backend.Core.Services; using Newtonsoft.Json.Linq; using ProtoBuf; @@ -22,7 +23,9 @@ public class InboxQueue { if (expanded == null) throw new Exception("Failed to expand ASObject"); var obj = ASObject.Deserialize(expanded); if (obj == null) throw new Exception("Failed to deserialize ASObject"); - if (obj is not ASActivity activity) throw new NotImplementedException("Job data is not an ASActivity"); + if (obj is not ASActivity activity) { + throw new GracefulException("Job data is not an ASActivity", $"Type: {obj.Type}"); + } var apHandler = scope.GetRequiredService(); var logger = scope.GetRequiredService>(); diff --git a/Iceshrimp.Backend/Core/Services/QueueService.cs b/Iceshrimp.Backend/Core/Services/QueueService.cs index 6c7a334d..543a1bdd 100644 --- a/Iceshrimp.Backend/Core/Services/QueueService.cs +++ b/Iceshrimp.Backend/Core/Services/QueueService.cs @@ -1,5 +1,6 @@ using Iceshrimp.Backend.Core.Configuration; using Iceshrimp.Backend.Core.Helpers; +using Iceshrimp.Backend.Core.Middleware; using Iceshrimp.Backend.Core.Queues; using Microsoft.Extensions.Options; using ProtoBuf; @@ -98,7 +99,13 @@ public class JobQueue( job.ExceptionSource = e.TargetSite?.DeclaringType?.FullName ?? "Unknown"; var logger = scope.ServiceProvider.GetRequiredService>(); - logger.LogError("Failed to process job in {queue} queue: {error}", name, e.Message); + if (e is GracefulException { Details: not null } ce) { + logger.LogError("Failed to process job in {queue} queue: {error} - {details}", + name, ce.Message, ce.Details); + } + else { + logger.LogError("Failed to process job in {queue} queue: {error}", name, e.Message); + } } if (job.Status is Job.JobStatus.Failed) {