function LimitedHandleError(Message, URL, Line) { return HandleError(Message, URL, Line, true); } function HandleError(Message, URL, Line, Limited) { var TempError; var Error = new Array(); if (Message.indexOf("1FORMAT") == 0) { TempError = Message.split("~`~"); Error[0] = TempError[1]; Error[1] = TempError[2]; Error[2] = TempError[3]; Error[3] = URL; Error[4] = Line; } else if (Message.indexOf("2FORMAT") == 0) { TempError = Message.split("~`~"); Error[0] = TempError[1]; Error[1] = TempError[2]; Error[2] = ""; Error[3] = URL; Error[4] = Line; } else { Error[0] = "Javascript Error"; Error[1] = Message; Error[2] = ""; Error[3] = URL; Error[4] = Line; } if (Limited == true) { Error[5] = "true"; } RedirectError(Error) //Prevent the browser from displaying the standard error in the javascript console. return true; } function RedirectError(Error) { var QueryString = "?" + "Name={0}&Message={1}&Line={2}&URL={3}&StackTrace={4}&Limited={5}"; var Index = 0; if (Error.length == 5) { Error[5] = "false"; } //Build the querystring. for (Index = 0; Index < Error.length; Index++) { QueryString = QueryString.replace("{" + Index + "}", encodeURIComponent(Error[Index])); } //Redirect to the error handling page. if (WebRoot == null) { var msg; Msg = "" for (Index = 0; Index < 5; Index++) { msg += Error[Index] + "\n"; } alert(msg + "\n" + BYOResources.BYO_RESOURCE_ERRORHANDLERJS_ERROR); } else { window.location.href = WebRoot + "Errors/Error.aspx" + QueryString; } }