Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Since you have the debugger catching the exception and have determined that the Exception is being thrown by the method named 'CameraAlarmActivate', then you could set a breakpoint at the top of the method and step through it until the Exception hits. You can then inspect the variables and troubleshoot accordingly. </p> <p>From the Exception object you can also get more information. </p> <pre><code>// Get stack trace for the exception with source file information var st = new StackTrace(ex, true); // Get the top stack frame var frame = st.GetFrame(0); // Get the line number from the stack frame var line = frame.GetFileLineNumber(); </code></pre> <p>From here: <a href="https://stackoverflow.com/questions/3328990/c-sharp-get-line-number-which-thrown-expection">C# - get line number which threw exception</a></p> <p>In general it isn't very good practice to have empty exception handler's because errors can go unnoticed. I would suggest at least integrating a logging library so your application has its own log file and then writing an error log entry from all exceptions. You can also write other verbose type of logs that can help you trace through the applications state via the log file after an error has occurred. This is especially helpful from a Windows Service or any background based job where errors can happen at any place. Log4net is a good logging library that is easy to use: <a href="http://logging.apache.org/log4net/" rel="nofollow noreferrer">http://logging.apache.org/log4net/</a></p> <p>Other than that, a wild guess from a quick look at your code would be that your client connection could be dropping at some point and ClientServerConnection or ClientServerConnection.Instance could become NULL at some point. That would be a good example of something you can do within the exception block. You could catch that specific exception and then re-connect and re-try. </p> <p>Lastly, you might be missing certain symbols to debug that function with more detail, or you may have to enable some of the options your project related to debugging with unmanaged code. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload