Catching and neutralizing OgreException

codo

06-02-2010 14:49:38

Hi, I'm having problems with handling OgreException. Perhaps I'm trying to do something impossible :)
I want to catch and discard SEHException which is thrown when loading/decoding of image has failed:

try
{
string path = unpredictableImagePath();
TextureManager.Singleton.Load(path, "General");
}
catch (SEHException ex)
{

if (OgreException.IsThrown)
{
try
{
OgreException.ClearLastException();
File.Delete(path);
}
catch(Exception ex2)
{
}
}

return null;
}


This works and the exception is caught. The problem is that it's caught AGAIN outside the method at the main rendering loop. How to handle such situations?

codo

08-02-2010 19:52:47

Any ideas how to deal with it?