New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STYLE: Remove initial <<
insertion from itkExceptionMacro(<< "
calls
#4057
STYLE: Remove initial <<
insertion from itkExceptionMacro(<< "
calls
#4057
Conversation
Let the C++ preprocessor append the specified literal string to the error message, instead of doing the equivalent `<<` insertion at run-time. Aims to shorten the code a little bit, and improve consistency. The code base already had more than 750 `itkExceptionMacro` calls that passed a literal string directly, without having `<<` at its left side.
@@ -1211,14 +1211,14 @@ GDCMImageIO::Write(const void * buffer) | |||
outpixeltype.SetPixelRepresentation(static_cast<unsigned short>(std::stoi(pixelRep.c_str()))); | |||
if (this->GetNumberOfComponents() != 1) | |||
{ | |||
itkExceptionMacro(<< "Sorry Dave I can't do that"); | |||
itkExceptionMacro("Sorry Dave I can't do that"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“I'm sorry, Dave. I'm afraid I can't do that,” said HAL 9000
(c) 2001: A Space Odyssey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reference, Mihail! Honestly I doubt if such an error message is very helpful to the user. In general, I'm not a fan of "funny" error messages. Unless they really help to communicate to the user what's going wrong. But anyway, that's beyond the scope of this pull request!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't use funny error messages too. I am not sure what this one means, just reminded me of the citation from the movie, but it may be something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is an error message which is not supposed to be reachable by the GDCM's users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe... but then I guess the message is only for someone named Dave 😸 Thanks for merging @dzenanz !
Oops, I see now:
Meaning that the PR has actually added more lines of code! Oops! I'm sorry 😸 ! |
Follow-up to pull request InsightSoftwareConsortium#4057 commit 89beb04 "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls"
Follow-up to pull request InsightSoftwareConsortium#4057 commit 89beb04 "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls" Aims to shorten the code a little bit, and improve consistency. The code base already had more than 500 `itkDebugMacro` calls that passed a literal string as first argument directly, without having `<<` at its left side.
Follow-up to pull request InsightSoftwareConsortium#4057 commit 89beb04 "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls" Aims to shorten the code a little bit, and improve consistency. The code base already had more than 80 `itkWarningMacro` calls that passed a literal string as first argument directly, without having `<<` at its left side.
Follow-up to pull request InsightSoftwareConsortium#4057 commit 89beb04 "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls" Aims to shorten the code a little bit, and improve consistency. The code base already had seven `itkGenericOutputMacro` calls that passed a literal string as first argument directly, without having `<<` at its left side.
Follow-up to pull request #4057 commit 89beb04 "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls" Aims to shorten the code a little bit, and improve consistency. The code base already had more than 500 `itkDebugMacro` calls that passed a literal string as first argument directly, without having `<<` at its left side.
Follow-up to pull request #4057 commit 89beb04 "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls" Aims to shorten the code a little bit, and improve consistency. The code base already had more than 80 `itkWarningMacro` calls that passed a literal string as first argument directly, without having `<<` at its left side.
Follow-up to pull request #4057 commit 89beb04 "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls" Aims to shorten the code a little bit, and improve consistency. The code base already had seven `itkGenericOutputMacro` calls that passed a literal string as first argument directly, without having `<<` at its left side.
Let the C++ preprocessor append the specified literal string to the error message, instead of doing the equivalent
<<
insertion at run-time.Aims to shorten the code a little bit, and improve consistency. The code base already had more than 750
itkExceptionMacro
calls that passed a literal string directly, without having<<
at its left side.