public static async Task SaveUnhandledExceptionAsync(string applicationName, IFolder exceptionLogFolder, Exception exception, string source) { await ExceptionSaver.SaveUnhandledExceptionAsync(exceptionLogFolder, exception, source, async e => { var container = new ContainerBuilder().UsePegh(applicationName, new DummyCsArgumentPrompter()).Build(); var repository = container.Resolve <ISecretRepository>(); var securedHttpGateSettingsSecret = new SecretSecuredHttpGateSettings(); var errorsAndInfos = new ErrorsAndInfos(); var securedHttpGateSettings = await repository.GetAsync(securedHttpGateSettingsSecret, errorsAndInfos); ISecuredHttpGate gate = new SecuredHttpGate(new HttpGate(), securedHttpGateSettings, container.Resolve <IFolderResolver>(), container.Resolve <IStringCrypter>()); await gate.RegisterDefectAsync(e.ExceptionName, e.FileContents, false); }); }
public override void OnException(ExceptionContext context) { ExceptionSaver.SaveUnhandledException(ExceptionLogFolder, context.Exception, nameof(Dvin), e => { }); context.Result = new JsonResult(InternalServerError.Create("An exception was logged. We are sorry for the inconvenience.")); }