private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context) { try { handler.Handler(context); } catch (BadRequestException) { context.Response.StatusCode = HttpStatusCode.BadRequest; } }