Activating PTZ preset throws System.Net.WebException inside MIPSDK. How to handle this exception if it is not propagated out of the SDK?

In our code we send ptz command:

EnvironmentManager.Instance.SendMessage(new Message(messageId, relatedFqid, commandData), itemFqid);

This call timeouts for some reason and then there is exception thrown:

System.Net.WebException: Unable to connect to the remote server

which is caught withing MIPSDK. Also there is no return value for SendMessage and no MessageId.Server.NewEventIndication. How to react to such event?

Hi Peter,

Sadly it’s not currently possible to monitor or get any kind of feedback from the SendMessage method, and all exceptions within it are silently swallowed up by the SDK (although exceptions should show up in the MIP logs).

I’ve added improving this to our list of future improvements, but I can’t say when we might get to it.

Best regards

Simon Rønneberg

Thanks for your answer. I have followed this how-to article about enabling MIP logs: https://developer.milestonesys.com/s/article/enabling-MIP-log-traces-in-the-Event-Server-how-to.

I tried enabling MIP logs on 2020R3 as well as on 2021R1 but could not make it work. Do you maybe know of some other way?

I am sorry for delayed reply. I just tested if MIPlog works when I use XPCO 2020 R3 + SDK 2022 R1. I have not tested your actual code but basically MIPyyyy-mm-dd.log has updated and I could see the logs so it seems it works fine.