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.
| 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.
“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.
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.
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.
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.
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.
Follow-up to pull request InsightSoftwareConsortium#4057 commit ddf899a "STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls"
Follow-up to pull request InsightSoftwareConsortium#4057 commit ddf899a "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 ddf899a "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 ddf899a "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
itkExceptionMacrocalls that passed a literal string directly, without having<<at its left side.