private static void HandleIndexDisabledException(HttpActionExecutedContext ctx, IndexDisabledException e)
        {
            ctx.Response = new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.InternalServerError,
            };

            SerializeError(ctx, new
            {
                Url = ctx.Request.RequestUri.PathAndQuery,
                Error = e.Information == null ? e.ToString() : e.Information.GetErrorMessage(),
            });
        }
Exemple #2
0
			private static void HandleIndexDisabledException(IHttpContext ctx, IndexDisabledException e)
			{
				ctx.Response.StatusCode = 503;
				ctx.Response.StatusDescription = "Service Unavailable";
				SerializeError(ctx, new
				{
					Url = ctx.Request.RawUrl,
					Error = e.Information.GetErrorMessage(),
					Index = e.Information.Name,
				});
			}