Deactivate does not return error code when disconnected

I am calling Deactivate() when network is disconnected.Currently Deactivate() does not deactivate the product when network is not available and does not return any error code to indicate this condition.So I need to call IsActivated() right after to evaluate if Deactivate() call was successful.It would be nice to have proper error code from Deactivate() when deactivation is not successful.

>> "Currently Deactivate() does not deactivate the product when network is not available and does not return any error code to indicate this condition."

What language are you using? In C/C++ Deactivate() will return TA_E_INET. On other languages it will throw an exception. So don't swallow exceptions.

>> "So I need to call IsActivated() right after to evaluate if Deactivate() call was successful."

No.

>> "It would be nice to have proper error code from Deactivate() when deactivation is not successful."

It does. More information is needed if you're still having problems. Starting with a code snippet.

I am using C# but with my wrapper that does not throw exceptions - just return code.

But I was wrong. It does indeed returns TA_E_INET.

Still the main problem is that product is left Activated.Therefore I need to call DeactivationRequestToFile() to deactivate it.

Here is my current Deactivate function:

TurboActivate.Deactivate();

// check if deactivation was successfull if (TurboActivate.IsActivated()) { TurboActivate.DeactivationRequestToFile(fullPath, false); }