public async Task RunAsync() { try { await EnsureCertificateAsync(); } catch (LetsEncryptException ex) { if (ErrorHandler != null) { var errorInfo = new ErrorInfo { Continue = ContinueHandler != null, Exception = ex }; ErrorHandler(errorInfo); if (!errorInfo.Continue) { ContinueHandler = null; } } } // Retrieve the certificate from loader CertificateLoader.TryLoad(Options.Hostname, out var certificate); // This starts the actual web app await ContinueHandler ?.Invoke(certificate) ?.RunAsync(); }
public void Run() { try { EnsureCertificate(); } catch (LetsEncryptException ex) { Logger?.LogError(ex, ex.InnerException?.Message); if (ErrorHandler != null) { var errorInfo = new ErrorInfo { Continue = ContinueHandler != null, Exception = ex }; ErrorHandler(errorInfo); if (!errorInfo.Continue) { ContinueHandler = null; } } } // Retrieve the certificate from loader CertificateLoader.TryLoad(Options.Hostname, out var certificate); // This starts the actual web app ContinueHandler ?.Invoke(certificate) ?.Run(); }
public BitsException(string message, Exception exception, Stream file, long position, BitsRequest request, ContinueHandler handler, RequestProgressHandler progressHandler, object result) : base(message, exception) { this.Position = position; this.Request = request; this.Content = file; this.Continue += handler; this.Handler = progressHandler; Result = result; }