﻿//this is used to catch Asp.net ajax errors so the alert dialog is suppressed
//and the error is logged.

Sys.Application.add_load(AppLoad);

function AppLoad() {
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
}

function EndRequest(sender, args) {
    // check for error on request
    if (args.get_error() != undefined) {
        LogSysRequestError(args.get_error().toString());        

        // Let the framework know that the error is handled, so it doesn't throw the JavaScript alert.
        args.set_errorHandled(true);
    }
	else {
		ClearSysRequestError();
	}
}


