Example #1
0
 /**
  * All exceptions comes here
  * Override this method for custom exception handling
  *
  * @param Exception $e
  * @return mixed
  */
 public function catchException(jqGrid_Exception $e)
 {
     #More output types will be added
     switch ($e->getOutputType()) {
         case 'json':
             $r = array('error' => 1, 'error_msg' => $e->getMessage(), 'error_code' => $e->getCode(), 'error_data' => $e->getData(), 'error_type' => $e->getExceptionType());
             if ($this->loader->get('debug_output')) {
                 $r['error_string'] = (string) $e;
             }
             $this->json($r);
             break;
     }
     return $e;
 }
Example #2
0
File: jqGrid.php Project: Moro3/duc
 /**
  * All exceptions comes here
  * Override this method for custom exception handling
  *
  * @param jqGrid_Exception $e
  * @return mixed
  */
 public function catchException(jqGrid_Exception $e)
 {
     #More output types will be added
     switch ($e->getOutputType()) {
         case 'json':
             $r = array('error' => 1, 'error_msg' => $e->getMessage(), 'error_code' => $e->getCode(), 'error_data' => $e->getData(), 'error_type' => $e->getExceptionType());
             if ($this->loader->get('debug_output')) {
                 $r['error_string'] = (string) $e;
             } else {
                 if ($e instanceof jqGrid_Exception_DB) {
                     unset($r['error_data']['query']);
                 }
             }
             $this->json($r);
             break;
         case 'trigger_error':
             trigger_error($e->getMessage(), E_USER_ERROR);
             break;
     }
     return $e;
 }