Best practices to handle errors

Hi all, when we can connect to all devices but some task does not apply correctly on a device, we can handle the error and have the devices list onto which there was an issue:

try:
    result = nr.run(
        napalm_get,
        getters=['get_facts']
    )
    print_result(result)

except NornirExecutionError:
    print('{0}Issue on: {1}'.
        format(Fore.RED, nr.data.failed_hosts))

But what if we cannot connect on a device?
Is there a nice way to have the devices list onto which connection was impossible?

Thanks
Regards

If you want to have special treatment for connections you can handle them by connecting explicitly:

https://nornir.readthedocs.io/en/stable/howto/handling_connections.html