Raise on db errors

Closes #216