fix: more coherent exception handling and logging