discovery: more exception handling and logging