Exemplo n.º 1
0
        public override void OnActionExecuted(HttpActionExecutedContext context)
        {
            base.OnActionExecuted(context);

            // Don't bother processing bad StatusCodes if there is an exception attached - it will be handled by another part of the framework.
            if (context != null && context.Exception == null && context.Response != null && (int)context.Response.StatusCode >= 400)
            {
                Exception e = new RaygunWebApiHttpException(
                    string.Format("HTTP {0} returned while handling Request {2} {1}", (int)context.Response.StatusCode, context.Request.RequestUri, context.Request.Method),
                    context.Response);

                _clientCreator.GenerateRaygunWebApiClient(context.Request).SendInBackground(e);
            }
        }
Exemplo n.º 2
0
    public override void OnActionExecuted(HttpActionExecutedContext context)
    {
      base.OnActionExecuted(context);

      // Don't bother processing bad StatusCodes if there is an exception attached - it will be handled by another part of the framework.
      if (context != null && context.Exception == null && context.Response != null && (int)context.Response.StatusCode >= 400)
      {
        Exception e = new RaygunWebApiHttpException(
          context.Response.StatusCode,
          context.Response.ReasonPhrase,
          string.Format("HTTP {0} returned while handling Request {2} {1}", (int)context.Response.StatusCode, context.Request.RequestUri, context.Request.Method));

        _clientCreator.GenerateRaygunWebApiClient(context.Request).SendInBackground(e);
      }
    }
        public override void OnActionExecuted(HttpActionExecutedContext context)
        {
            base.OnActionExecuted(context);

            // Don't bother processing bad StatusCodes if there is an exception attached - it will be handled by another part of the framework.
            if (context != null && context.Exception == null && context.Response != null && (int)context.Response.StatusCode >= 400)
            {
                var e = new RaygunWebApiHttpException(
                    $"HTTP {(int)context.Response.StatusCode} returned while handling Request {context.Request.Method} {context.Request.RequestUri}",
                    context.Response);

                _clientCreator.GenerateRaygunWebApiClient(context.Request).SendInBackground(e, new List <string> {
                    RaygunWebApiClient.UnhandledExceptionTag
                });
            }
        }