Skip to content

make ComIOException inherit public interface of ComException

This MR sets ComIOException to inherit the public interface of ComException, here.

Without this, code that does:


void function_foo()
{
   throw ComIOException("ComIOException thrown!");
}

int main()
{
   try {
       function_foo();
   } catch(std::exception& e)
   {
      std::cout << "exception caught: " << e.what() << std::endl;
   }
   return 0;
}

Returns terminate called after throwing an instance of 'ComIOException' instead of exception caught: ComIOException thrown!. As it stands, it is required to change the catch call to explicitly catch ComIOException: catch(ComIOException& e). This MR allows to use instead catch(std::exception& e). This may be a matter of taste about being explicit (or not) about catching specific types of exception, but this MR at least appears to complete the inheritance of std::exception that ComException begins.

Merge request reports

Loading