With an exception that there is no solution or alternative to, for example failing to open an image, I usually do something like:
try
{
img.load_from_file("my_image.png");
}
catch( const image_loading_exception& e )
{
/* Could Not Load Image: 'my_image.png' ! */
string err = "Could Not Load Image: " + e.what() + " !"; //
pro::message_box::show( err );
}
Now, is this really good error handling? Should I do something more descriptive, or try to resolve the issue. Displaying a error message box is the only thing that I can think of when handling image or file loading failure. What do you guys do?
It depends what are requirements :