Exemplo n.º 1
0
        public async Task ReportActivityAsync(string activity)
        {
            var developerName = ExceptionHandlerUtilities.GetDeveloperName(this.requestContext.Request);
            var developer     = await this.developerRepository.TryGetByGitNameAsync(developerName);

            await this.activityReporter.ReportActivityAsync(activity, developer);
        }
        public Task ReportExceptionAndCreateResponseAsync <T>(
            BaseValidatingContext <T> context,
            Exception exception)
        {
            var developerName = ExceptionHandlerUtilities.GetDeveloperName(context.Request);

            return(ExceptionHandlerUtilities.ReportExceptionAndCreateResponseAsync(context, exception, developerName));
        }
        public Task <HttpResponseMessage> ReportExceptionAndCreateResponseAsync(
            HttpRequestMessage request,
            Exception exception)
        {
            var developerName = ExceptionHandlerUtilities.GetDeveloperName(request);

            return(ExceptionHandlerUtilities.ReportExceptionAndCreateResponseAsync(request, exception, developerName));
        }
Exemplo n.º 4
0
 public override async Task OnActionExecutingAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
 {
     if (actionContext.ModelState.IsValid == false)
     {
         var exception     = new ModelValidationException(actionContext.ModelState);
         var developerName = ExceptionHandlerUtilities.GetDeveloperName(actionContext.Request);
         actionContext.Response = await ExceptionHandlerUtilities.ReportExceptionAndCreateResponseAsync(actionContext.Request, exception, developerName);
     }
 }
        public override async Task OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)
        {
            var exception = actionExecutedContext.Exception;

            if (exception != null)
            {
                var developerName = ExceptionHandlerUtilities.GetDeveloperName(actionExecutedContext.Request);
                actionExecutedContext.Response = await ExceptionHandlerUtilities.ReportExceptionAndCreateResponseAsync(actionExecutedContext.Request, exception, developerName);
            }
        }
Exemplo n.º 6
0
        public async void ReportActivityInBackground(string activity)
        {
            var developerName = ExceptionHandlerUtilities.GetDeveloperName(this.requestContext.Request);
            var developer     = await this.developerRepository.TryGetByGitNameAsync(developerName);

            try
            {
                await this.activityReporter.ReportActivityAsync(activity, developer);
            }
            catch (Exception t)
            {
                this.exceptionHandler.ReportExceptionAsync(t, developerName);
            }
        }
Exemplo n.º 7
0
        public void ReportExceptionAsync(Exception exception)
        {
            var developerName = ExceptionHandlerUtilities.GetDeveloperName(this.requestContext.Request);

            ExceptionHandlerUtilities.ReportExceptionAsync(exception, developerName);
        }
        public void ReportExceptionAsync(IOwinRequest request, Exception exception)
        {
            var developerName = ExceptionHandlerUtilities.GetDeveloperName(request);

            ExceptionHandlerUtilities.ReportExceptionAsync(exception, developerName);
        }