db: add some more verbose error logging