-
Notifications
You must be signed in to change notification settings - Fork 97
refactor: Remove getDataContext duplication #3895
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
base: develop
Are you sure you want to change the base?
Conversation
… link between GEOS_THROW_CTX_IF and LVARRAY_THROW_IF_TEST( EXP, MSG, TYPE )
… in try/catch statements Problem: Retrieves everything that was thrown, so not just the message.
…/catch in main)": remove useless try/catch
…y spaces. The previous condition checked whether an argument was present and whether the option was immediately followed by a value like -test"value", which excluded valid cases like -test "value" et -test "value".
src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp
Outdated
Show resolved
Hide resolved
src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp
Outdated
Show resolved
Hide resolved
src/coreComponents/fieldSpecification/EquilibriumInitialCondition.cpp
Outdated
Show resolved
Hide resolved
| { | ||
| GEOS_THROW_IF( (m_xMax[0]<m_xMin[0] || m_xMax[1]<m_xMin[1] || m_xMax[2]<m_xMin[2]), | ||
| getCatalogName() << " " << getDataContext() << " " | ||
| getCatalogName() << " " |
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.
| getCatalogName() << " " |
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.
&↓∞
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.
There are still more below.
src/coreComponents/fieldSpecification/TractionBoundaryCondition.cpp
Outdated
Show resolved
Hide resolved
| GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | ||
| catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), |
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.
| GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | |
| catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), | |
| GEOS_FMT( "The flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | |
| onlyPlotSpecifiedFieldNamesString, fieldNamesString ), |
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.
&↓∞
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.
There are still data contexts in messages below, rather than in the macro parameters
| GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | ||
| catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), |
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.
| GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | |
| catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), | |
| GEOS_FMT( "the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | |
| onlyPlotSpecifiedFieldNamesString, fieldNamesString ), |
&↓∞
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.
There are still data contexts in messages below, rather than in the macro parameters
There are still catalog name too
|
@arng40 requested a lot of unmeaningful catalog-name / prefixes deletion as:
|
| "Mismatch between the size of " << | ||
| viewKeyStruct::componentNamesString() << | ||
| " and " << viewKeyStruct::componentFractionVsElevationTableNamesString(), | ||
| InputError ); |
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.
Forgotten data context here?
| { | ||
| GEOS_THROW_IF( (m_xMax[0]<m_xMin[0] || m_xMax[1]<m_xMin[1] || m_xMax[2]<m_xMin[2]), | ||
| getCatalogName() << " " << getDataContext() << " " | ||
| getCatalogName() << " " |
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.
There are still more below.
| GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | ||
| catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), |
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.
There are still data contexts in messages below, rather than in the macro parameters
| GEOS_FMT( "{} : the flag `{}` is different from zero, but `{}` is empty, which is inconsistent", | ||
| catalogName(), onlyPlotSpecifiedFieldNamesString, fieldNamesString ), |
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.
There are still data contexts in messages below, rather than in the macro parameters
There are still catalog name too
| subRegion.getDataContext() << | ||
| ": Material " << constitutiveRelation.getDataContext() << | ||
| " does not contain " << viewName, | ||
| "Material "<< constitutiveRelation.getName() << "does not contain " << viewName, |
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.
lacks a space
| ErrorLogger::global().currentErrorMsg() | ||
| .addToMsg( errorMsg ) | ||
| .addContextInfo( getDataContext().getContextInfo().setPriority( 1 ) ); |
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.
Bad merge?
| "WellControls " << wellControls.getName() << | ||
| " : Injection stream not specified for well " << subRegion.getName(), | ||
| InputError ); | ||
| "Injection stream not specified for well " << subRegion.getName(), |
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.
For those 4 messages, should we have "[...] for well sub-region " << subRegion.getName()? To ease readaction, can you give an instance of what is output from one of these messages? (from a real case)
| getWrapperDataContext( viewKeyStruct::injectionStreamString() ), | ||
| getWrapperDataContext( viewKeyStruct::injectionTemperatureString() ) ); |
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 think the output will be strange with two data contexts here, what about just one getDataContext()
| (m_targetMassRate <= 0.0 && m_targetMassRateTableName.empty()) && | ||
| (m_targetTotalRate <= 0.0 && m_targetTotalRateTableName.empty())), | ||
| "WellControls " << getDataContext() << ": You need to specify a phase, mass, or total rate constraint. \n" << | ||
| "You need to specify a phase, mass, or total rate constraint. \n" << |
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.
Doesn't this message lacks some separators?
| InputError ); | ||
| GEOS_FMT( "Region `{}` must be a target region of `{}`", | ||
| poromechanicsTargetRegionNames[i], this->flowSolver()->getCatalogName() ), | ||
| InputError, this->getDataContext(), this->solidMechanicsSolver()->getDataContext() ); |
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.
| InputError, this->getDataContext(), this->solidMechanicsSolver()->getDataContext() ); | |
| InputError, this->getDataContext(), this->flowSolver()->getDataContext() ); |
Remove all getDataContext() / getWrapperDataContext() / getName() written directly in the error message strings (getDataContext() << “: blabla”).
Add missing DataContexts when they are not present in the error DataContext parameters (GEOS_ERROR*, GEOS_ASSERT*, GEOS_WARNING*, GEOS_THROW*)