예제 #1
0
			private static void HandleJintException(IHttpContext ctx, JintException e)
			{
				while (e.InnerException is JintException)
				{
					e = (JintException)e.InnerException;
				}

				ctx.SetStatusToBadRequest();
				SerializeError(ctx, new
				{
					Url = ctx.Request.RawUrl,
					Error = e.Message
				});
			}
		private static void HandleJintException(HttpActionExecutedContext ctx, JintException e)
		{
			while (e.InnerException is JintException)
			{
				e = (JintException)e.InnerException;
			}

			ctx.Response = new HttpResponseMessage
			{
				StatusCode = HttpStatusCode.BadRequest,
			};

			SerializeError(ctx, new
			{
				Url = ctx.Request.RequestUri.PathAndQuery,
				Error = e.Message
			});
		}