문제

I have a project mvc4 web application. it is a chat application where users authenticated to chat in private room and can be not authenticated for public chats.I have elmah.axd package in my project to log all errors and it logs the "The connection id is in the incorrect format." error from signalR, every time user authenticated LogIn and LogOut. is there a way to catch it and not log it ?

도움이 되었습니까?

해결책

You tagged Elmah as your error reporting tool, so:

https://code.google.com/p/elmah/wiki/ErrorFiltering

To add an exception filter programmatically, put the following in your Global.asax file (or in the code-behind file):

// Don't forget to reference the Elmah assembly and import its namespace.

void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e)
{
    if (e.Exception.GetBaseException() is HttpRequestValidationException)
        e.Dismiss();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top