Commit 76dced8f authored by Victor Poughon's avatar Victor Poughon

REFAC: catch by const ref in otbTestMain.h

parent 72ab2865
Pipeline #254 passed with stage
in 38 minutes and 14 seconds
......@@ -314,21 +314,21 @@ int main(int ac, char* av[])
itkGenericExceptionMacro(<< "Function returns EXIT_FAILURE (not from regression, failure inside the test)");
}
}
catch (otb::ImageFileReaderException& e)
catch (const otb::ImageFileReaderException& e)
{
std::cerr << "otbTestMain '" << testToRun << "': ImageFileReaderException:" << std::endl;
std::cerr << e.GetFile() << ":" << e.GetLine() << ":" << std::endl;
std::cerr << std::string("Cannot open image ") + e.m_Filename + std::string(". ") + e.GetDescription() << std::endl;
result = EXIT_FAILURE;
}
catch (itk::ExceptionObject& e)
catch (const itk::ExceptionObject& e)
{
std::cerr << "otbTestMain '" << testToRun << "': ITK Exception thrown:" << std::endl;
std::cerr << e.GetFile() << ":" << e.GetLine() << ":" << std::endl;
std::cerr << e.GetDescription() << std::endl;
result = EXIT_FAILURE;
}
catch (std::bad_alloc& err)
catch (const std::bad_alloc& err)
{
std::cerr << "otbTestMain '" << testToRun << "': Exception bad_alloc thrown: " << std::endl;
std::cerr << (char*) err.what() << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment