Catch exceptions when no DB available

Fixes #115