Catching or preventing nuitrack::TerminateException

I’m using the Intel D435 camera in combination with the C# wrapper api to make an application. However, when I disconnect the camera I get a nuitrack::TerminateException which I can’t seem to catch. Since I want my program to keep running and show a status disconnected for the camera, I would like to know if it is possible to either catch the nuitrack::TerminateException or prevent this exception from completely shutting down my program.

One way is to run Nuitrack in a different thread but I’m hoping there is a more elegant solution which also doesn’t force me to reinitialize Nuitrack every time.

There no correct way to restart nuitrack after this sort of crash in c# currently.

In c++ you could capture the error and call release(); and then Initialise(); once a device is connected.

But given you are using an intel camera - you would also ideally need to call a realsense context and use that to track for connection of a sensor before calling initialise() .


Hi Joost,

We’ve reproduced this issue - indeed, there is no way to catch nuirack::TerminateException. We’ll try to fix this and let you know.

Any news on this topic? How can we detect if the camera is disconnected? Neither the TerminateException nor the OnLostUserEvent is thrown.

In the sample you see that nuitrack still shows the last picture with any skeleton tracked, once you disconnect the camera in between.

Fixing this issue is in our roadmap, but so far without an exact implementation date.