/**
 * Handles exceptions contained in data
 *
 * Exception data will be posted to Error/index
 */
function handleException(data) {
	if(data !== null) {
		if (data.isException) {
			// build exception data form
			var html = '<form name="exceptionForm" id="exceptionForm" method="post" action="' + ajaxExceptionUrl + '" style="visible:hidden">';
			for (var key in data.exception) {
				html += '<input type="hidden" name="' + key + '" value="' + escape(data.exception[key]) + '" />';	
			}
			html += '</form>';
			$("body").append(html);
			
			// submit exception data
			$("#exceptionForm").submit();
		}
		return;
	}
}
