Where to catch exceptions thrown in ajaxUpdateError


Does anyone know where should I place try/catch statements in order to catch exceptions thrown in ajaxUpdateError function.

Following is my code for CGridView


'ajaxUpdateError'=>'function(xhr,ts,et,err){ throw "Error" }',




		   		'delete'=>array('click'=>'js:function (){


		   			stocksCnt = $(this).parents("td").siblings(":nth-child(4)").text();

		   			$this = $(this);

		   			uiConfirm("Delete Confirmation","This pack have "+stocksCnt+" stock item(s) added to the system. Are you sure you want to delete it?",function (){		   				

						$.fn.yiiGridView.update("packs-grid", {



			                success:function() {


			                    $("#uiConfirm").dialog( "close" );






			                	uiAlert("Exception","exception caught");


		   			return false;



			'template' => '{delete}'



I have placed a try catch block before the cgridview’s update function call but the alert does not show up and I get “unhandled exception” error.

Does anyone know how should I handle this?


Hi Sadaf it would be a hack try to validate your data in CGridView like empty(whateverObject)?’’:‘now it will not through any error save to print’