Catch an unknown exception

  • Thread starter Thread starter HansvB69
  • Start date Start date
H

HansvB69

Guest
Hi,


Is there a way to catch an unknown exception? I have this:

catch (IndexOutOfRangeException ex)
{
Logging.WriteToLogError("Index out of range");
Logging.WriteToLogError("Melding:");
Logging.WriteToLogError(ex.Message);
}
catch (Exception ex)
{
Logging.WriteToLogError("Melding:");
Logging.WriteToLogError(ex.Message);
Logging.WriteToLogError("");
}

The second catch gives a warning. It is not specific enough. That is on purpose because i do not know the exception in advance.


Greatings Hans

Continue reading...
 
Back
Top