mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
chore: clean up .net sentry exceptions
This commit is contained in:
parent
ce0983ba16
commit
09ed215e6c
6 changed files with 38 additions and 17 deletions
|
|
@ -2,6 +2,8 @@ using Autofac.Extensions.DependencyInjection;
|
|||
|
||||
using PluralKit.Core;
|
||||
|
||||
using Sentry;
|
||||
|
||||
using Serilog;
|
||||
|
||||
namespace PluralKit.API;
|
||||
|
|
@ -21,9 +23,16 @@ public class Program
|
|||
opts.Dsn = config.SentryUrl ?? "";
|
||||
opts.Release = BuildInfoService.FullVersion;
|
||||
opts.AutoSessionTracking = true;
|
||||
// opts.DisableTaskUnobservedTaskExceptionCapture();
|
||||
opts.DisableUnobservedTaskExceptionCapture();
|
||||
});
|
||||
|
||||
TaskScheduler.UnobservedTaskException += (_, e) =>
|
||||
{
|
||||
foreach (var inner in e.Exception.Flatten().InnerExceptions)
|
||||
SentrySdk.CaptureException(inner);
|
||||
e.SetObserved();
|
||||
};
|
||||
|
||||
await host.Services.GetRequiredService<RedisService>().InitAsync(config);
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue