unreachable stats from module

Hello,

I’m currently developing a module used to connect to network devices using Exscript and Ansible as local connection.
I’d like to know if ansible module is able to tell the playbook stats if the remote device is unreachable rather that failed.

When using the local connection, it is currently impossible to have device unreachable state (as we run the module on the local machine).
When the ansible module fails for some reason, it automatically set the fail state without option to set unreachable to my knowledge.

Does anyone has any insight regarding this “issue” ?

Only connection plugins can determine if a machine is unreachable,
which you bypass by using the local one and having the module do the
networking itself. But you can pass information in the msg= on module
failure as to what caused the failure and let the user know 'device
was unreachable'.