[sqlite]: Tighten up error handling