public static IApplicationBuilder UseElectronCrashReportHandler(this IApplicationBuilder app, PathString mapPath, Func <IElectronCrashReport, HttpContext, Task> crashReportHandler)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }
            if (crashReportHandler == null)
            {
                throw new ArgumentNullException(nameof(crashReportHandler));
            }
            if (string.IsNullOrEmpty(mapPath))
            {
                throw new ArgumentNullException(nameof(mapPath));
            }

            ElectronCrashCollectorConfiguration config = new ElectronCrashCollectorConfiguration()
            {
                ElectronCrashReportHandler = crashReportHandler,
                MapPath = mapPath,
            };

            app.UseMiddleware <ElectronCrashCollectorMiddleware>(config);

            return(app);
        }
Exemplo n.º 2
0
 public ElectronCrashCollectorMiddleware(RequestDelegate next, ElectronCrashCollectorConfiguration config)
 {
     _next   = next ?? throw new ArgumentNullException(nameof(next));
     _config = config ?? throw new ArgumentNullException(nameof(config));
 }