作者 邓超

1

@@ -81,10 +81,14 @@ class DbPool { @@ -81,10 +81,14 @@ class DbPool {
81 $timer = microtime(true); 81 $timer = microtime(true);
82 } 82 }
83 83
84 - $query = $this->getClient()->prepare($sql);  
85 -  
86 - $ret = $query->execute($params);  
87 84
  85 + try {
  86 + $query = $this->getClient()->prepare($sql);
  87 + $ret = $query->execute($params);
  88 + }catch (\PDOException $e){
  89 + logs($e->getMessage().$e->getTraceAsString());
  90 + $ret = false;
  91 + }
88 92
89 93
90 if(APP_DEBUG){ 94 if(APP_DEBUG){