我正在尝试在 PHP 中捕获所有 SQLite3 错误的方法?我已经尝试了很多,它们似乎都有效。考虑下面的代码,是否足以捕获所有错误?有人可以提出其他建议吗?
$result = $stmt->execute();
if ($this->db->lastErrorCode()){
throw new DatabaseError($this->db->lastErrorMsg(),
$this->db->lastErrorCode());
} else {
return $this->db->changes();
}