The documentation is here: ArduinoIoTCloud/src at master · arduino-libraries/ArduinoIoTCloud · GitHub
and here: Arduino_ConnectionHandler/Arduino_ConnectionHandler.h at master · arduino-libraries/Arduino_ConnectionHandler · GitHub
You can check the status of the connection with conman.check() as you have done so in the loop, but testing the return code. Maybe you can do it early in setup() and, if it shows a failure, don't use any of the commands which depend on a connection. It returns a value indicating the status of the connection:
enum class NetworkConnectionState : unsigned int {
INIT = 0,
CONNECTING = 1,
CONNECTED = 2,
DISCONNECTING = 3,
DISCONNECTED = 4,
CLOSED = 5,
ERROR = 6
};
so you could possibly do a test like:
if ( conMan.check() != NetworkConnectionState::CONNECTED ) {
// we are not connected
}
Hopefully, someone with practical experience with this platform can say some more.