exit(1) does not leave any chance to catch exceptions. It also kills interactive Python sessions.
The current code in IRTK looks like this:
https://github.com/BioMedIA/IRTK/blob/master/Modules/Image/src/irtkFileNIFTIToImage.cc#L173
cerr << "irtkFileNIFTIToImage::ReadHeader: Number of dimensions > 5 (Number of dimensions = " << hdr.nim->dim[0] << ") \n";
exit(1);
on the other hand the code in IRTK-LEGACY looks like this:
https://github.com/BioMedIA/IRTK/blob/master/Modules/Image/src/irtkFileNIFTIToImage.cc#L173
stringstream msg;
msg << "irtkFileNIFTIToImage::ReadHeader: Number of dimensions > 5 (Number of dimensions = " << hdr.nim->dim[0] << ") \n";
cerr << msg.str();
throw irtkException( msg.str(),
__FILE__,
__LINE__ );
Are you happy with exit(1)? Do you agree with the syntax and formating in IRTK-LEGACY or would rather have a different way of throwing exceptions?
Note that irtkExceptions are still there: https://github.com/BioMedIA/IRTK/blob/master/Modules/Common/include/irtkException.h
exit(1)does not leave any chance to catch exceptions. It also kills interactive Python sessions.The current code in IRTK looks like this:
https://github.com/BioMedIA/IRTK/blob/master/Modules/Image/src/irtkFileNIFTIToImage.cc#L173
on the other hand the code in IRTK-LEGACY looks like this:
https://github.com/BioMedIA/IRTK/blob/master/Modules/Image/src/irtkFileNIFTIToImage.cc#L173
Are you happy with
exit(1)? Do you agree with the syntax and formating in IRTK-LEGACY or would rather have a different way of throwing exceptions?Note that
irtkExceptions are still there: https://github.com/BioMedIA/IRTK/blob/master/Modules/Common/include/irtkException.h