当我在调试模式下启动我的ASP.Net 4.0 Web应用程序时,我收到以下异常:
System.Web.HttpException occurred
Message=Invalid file name for file monitoring: 'C:\src\main-232\src\ZNode\Znode_MultiFront\Web\Controls\Cat5\Navigation'. Common reasons for failure include:
- The filename is not a valid Win32 file name.
- The filename is not an absolute path.
- The filename contains wildcard characters.
- The file specified is a directory.
- Access denied.
Source=System.Web
ErrorCode=-2147024809
WebEventCode=0
StackTrace:
at System.Web.DirectoryMonitor.AddFileMonitor(String file)
InnerException:
Run Code Online (Sandbox Code Playgroud)
问题是,这是指向IS目录的文件,为什么Visual Studio 2010认为它是一个文件?我在本地计算机上的IIS 7上运行它
当我通过Google AppEngine调用Google地球引擎(GEE)Python API时,它会抛出HTTPException,其中显示" HTTPException:无效和/或缺少网址的SSL证书:https://accounts.google.com/o/oauth2 / token ".该项目在新年假期之前运行良好,但是当我在昨天进行测试时突然爆发而我的代码没有任何变化.
ssl google-app-engine httpexception python-2.7 google-earth-engine
好的,所以我对这个问题很难过.我已经看到很多应该解决这个问题的事情,但是我没有得到满足我要求的解决方案.
我正在使用ELMAH来记录异常,并且当具有无效控制器的URL或适当的控制器和无效操作时,我会收到此异常.
System.Web.HttpException: The controller for path '/BadController' was not found or does not implement IController.
at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Run Code Online (Sandbox Code Playgroud)
我想阻止这个异常被抛出.我正在使用自定义错误,它们工作正常,因为应用程序将发送到我的自定义404错误页面.但是,异常仍会被记录.
我有[HandleError]属性装饰所有控制器.这可能吗?如果是这样,我将不胜感激任何帮助.
我已经尝试过,设置一个重定向的最终路由,但无论出于何种原因,它都匹配之前的路由.我试图使用httpModule,并在文件的情况Application_Error下清除Global.asax.没有什么能阻止这种例外.
再次感谢任何帮助!
如果在本网站上已经回答了这个问题,我很抱歉,但我没有找到这个确切的情况.
我正在将log4net添加到WCF服务.我在Application_Error事件中添加了一个处理程序,它在每个请求中捕获一个找不到文件的错误.
我已经在网站上看到了这一点,通常错误可以追溯到根目录中没有"favicon"文件,或者css样式表中引用的缺失图像.
但是,这是一个WCF服务,没有CSS样式表,并且向根添加favicon没有解决问题.
有没有其他人有一个很好的方法来解决这个问题?
一些线索:
我添加了错误消息的url和文件路径,这就是它们:
FilePath: /
错误: System.Web.HttpException(0x80004005):文件不存在.
编辑:以上值显示在记录的异常中:
protected void Application_Error(object sender, EventArgs e)
{
var objErr = Server.GetLastError().GetBaseException();
if (objErr is System.Web.HttpException)
{
var filePath = Context.Request.FilePath;
var url = ((HttpApplication) sender).Context.Request.Url;
Log.Error("URL: " + url + "; FilePath: " + filePath, objErr);
} else
Log.Error("Application Error", objErr);
}
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.
我正在调用 post API,有时我从服务器得到响应,有时我收到异常Connection closed while receiving data。两种情况下的请求都相同,并且根据后端服务器日志,发送了响应,但我没有收到。我在模拟器和实际设备中都有这个问题。
try {
final result =
await http.post(url, body: encodedBody, headers: apiHeader);
Map<String, dynamic> response = json.decode(result.body);
print("Response: $response");
return response;
} catch (error) {
Map<String, dynamic> response = Map<String, dynamic>();
response['success'] = false;
response['message'] = error;
return response;
}
Run Code Online (Sandbox Code Playgroud) 我遇到了与本文中描述的相同的问题,诊断"请求超时"HttpExceptions.我按照建议打开了失败的请求跟踪,并且正在与MS的某个人合作(虽然它很慢).
原始帖子一年多没有更新,所以我想知道是否找到了修复程序,或者你是否只是忽略了这些错误.
任何帮助,将不胜感激.
我试图从Global asax Application_Error中抛出此行
throw new HttpException((int)HttpStatusCode.Unauthorized, "Forbidden");
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,我在浏览器中得到200而不是401,你知道为什么吗?
更新:
protected void Application_Error(object sender, EventArgs e)
{
throw new HttpException((int)HttpStatusCode.Unauthorized, "Forbidden");
}
Run Code Online (Sandbox Code Playgroud) Flask 400exception(abort())的默认消息是:
{
"message": "The browser (or proxy) sent a request that this server could not understand."
}
Run Code Online (Sandbox Code Playgroud)
用于404:
{
"message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. You have requested this URI [/obj/] but did you mean /obj/ or /obj/<int:id>/ or /obj/<int:id>/kill/ ?"
}
Run Code Online (Sandbox Code Playgroud)
当我将它们作为我的API中的回复(特别是第一个,我认为加密或标题有问题)时,我无法理解这些消息.我觉得尝试为每个abort()异常手动覆盖文本都很烦人.所以我改变了映射:
from flask import abort
from werkzeug.exceptions import HTTPException
class BadRequest(HTTPException):
code = …Run Code Online (Sandbox Code Playgroud) 我们有一些移动客户端正在使用的Web服务,其中移动客户端发出一些请求并返回响应.不知何故,如果客户端发出任何无效请求,我们会抛出Custom Exceptions.
但最近移动客户端提出了一些超出范围Long变量的请求.
客户端有不同的变量为ex ::
{
"accountId":"343"
"Amount":"90909090909090909090"
}
Run Code Online (Sandbox Code Playgroud)
如果accountId或Amount的值超过19位,我们会得到HttpMessageNotReadable异常,因为范围超出了long值.但是从异常中我无法获取异常被提出的变量,无论是for accountId还是Amount.从异常我得到的信息_path变量,但我无法获取它.

在路径变量我得到像::
[com.Upload["AccountInfo"], com.Info["Account"]]
Run Code Online (Sandbox Code Playgroud)
有人知道如何获取这些信息.
目前,我在运行Flutter应用程序时遇到问题。我尝试搜索解决方案,但实际上都不是我的情况。问题是,当我尝试安装应用程序时,有时它会开始运行,但立即崩溃,甚至无法生成,并抛出此异常(即使使用flutter演示项目):
Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:57564/ws".
Run Code Online (Sandbox Code Playgroud)
到目前为止,我已经尝试过:清理现金,重新安装flutter / android studio。我只有几个(android os)手机遇到了这个问题。导入'package:flutter / material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(appBar: AppBar(title: Text("App"))),
);
}
}
Run Code Online (Sandbox Code Playgroud)