Skip to content

Commit

Permalink
ENH: Convert unspecified exceptions to itk
Browse files Browse the repository at this point in the history
Ensure that caught exceptions are converted to itk::Exception objects.
  • Loading branch information
hjmjohnson committed Aug 8, 2022
1 parent 63590b8 commit fcf8b39
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Modules/IO/HDF5/src/itkHDF5ImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,11 @@ HDF5ImageIO ::ReadImageInformation()
{
itkExceptionMacro(<< error.getCDetailMsg());
}
catch (...)
{
itkExceptionMacro(<< "Unspecified error occured during ReadImageInformation " << this->GetFileName() << " with "
<< this->GetNameOfClass());
}
}

void
Expand Down Expand Up @@ -1246,6 +1251,11 @@ HDF5ImageIO ::WriteImageInformation()
{
itkExceptionMacro(<< error.getCDetailMsg());
}
catch (...)
{
itkExceptionMacro(<< "Unspecified error occured during WriteImageInformation: " << this->GetFileName() << " with "
<< this->GetNameOfClass());
}
//
// only write image information once.
this->m_ImageInformationWritten = true;
Expand Down Expand Up @@ -1301,6 +1311,11 @@ HDF5ImageIO ::Write(const void * buffer)
{
itkExceptionMacro(<< error.getCDetailMsg());
}
catch (...)
{
itkExceptionMacro(<< "Unspecified error occured during Write: " << this->GetFileName() << " with "
<< this->GetNameOfClass());
}
}

//
Expand Down

0 comments on commit fcf8b39

Please sign in to comment.