Salient Solutions

wrasslin ones and nones for fun and profit - Sky Sanders' Blog
posts - 96, comments - 70, trackbacks - 0

Saturday, February 27, 2010

Testing and Parsing an ASP.NET YSOD (Yellow Screen Of Death) from an XMLHttpRequest.responseText

 

After a minor bout of forgetfulness regarding legal regexp flags in Javascript, I knocked this one out that parses the comment block at the end of an YSOD.

 

var rxYSOD = /<!--\s*\[(.*?)]:(\s*.*\s(.*[\n\r]*)*?)\s*(at(.*[\n\r]*)*)-->/;
if (rxYSOD.test(text)) {
    // looks like one..
    var ysod = rxYSOD.exec(text);
    errObj = { Message: ysod[2], StackTrace: ysod[4], ExceptionType: ysod[1] };
}

will find and parse the comment block shown. I am guessing that is why they put it there....

 

<html>
<!-- omitted -->
    <body bgcolor="white">
		<!-- omitted -->
    </body>
</html>
<!-- 
[ArgumentException]: Unknown web method ValidateUser.
Parameter name: methodName
   at System.Web.Script.Services.WebServiceData.GetMethodData(String methodName)
   at System.Web.Script.Services.RestHandler.CreateHandler(WebServiceData webServiceData, String methodName)
   at System.Web.Script.Services.RestHandler.CreateHandler(HttpContext context)
   at System.Web.Script.Services.RestHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
   at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
s
Technorati tags: , ,

posted @ Saturday, February 27, 2010 11:46 PM | Feedback (0) | Filed Under [ CodeProject-Tip ]

Tools I am using......

I just thought I might keep an ongoing list of some of tools that I use daily.

This list is not inclusive and some of the obvious will be tacked on periodically.

 

 

 

posted @ Saturday, February 27, 2010 10:09 PM | Feedback (0) |

Powered by: