Where to catch exceptions thrown in ajaxUpdateError

Hello,

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" }',

...






.....


 'buttons'=>array(		    	

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

		   			try{

		   			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", {

			                type:"POST",

			                url:$this.attr("href"),

			                success:function() {

			                    $.fn.yiiGridView.update("packs-grid");

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

			                }

			        	});

			                

		   			});

			                }catch(e){

			                	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?

Regards,

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’