Ensure we handle database errors