Better exception handling of NanopubDb