Defect - Fix 11185 incorrect severe tariff error#11201
Defect - Fix 11185 incorrect severe tariff error#11201mitchute merged 8 commits intoNatLabRockies:developfrom
Conversation
…de more information
…-11185-Incorrect-Severe-Tariff-Error
|
The test files provided recreated the original error in develop and work properly in the branch with the revised code. |
|
@GaryMarksBigladder, is this a specific case of a general problem with using ShowSevereItemNotFound() that has now just been fixed for this specific case? The ShowSevereItemNotFound() is widely used. I don't think we want a little bandaid over a big problem. |
|
To the best of my knowledge, ShowSevereItemNotFound is working for other parts of the code. I noticed that just fixing the usage of ShowSevereItemNotFound, in this case, would still leave the user searching for information from warnings higher up instead of just giving them all the information they needed to fix their idf in the severe error message itself. That's why I made a new function that other code can call if they feel it makes sense in their usage. We could change ShowSevereItemNotFound for everyone, but I don't know if there is code out there that is programmatically looking for specific verbiage in the error, so it seemed safer to me to change it for this specific use case while allowing others in the future to decide which severe error message best fits their use case. Please let me know if that was not the correct course of action. |
|
Thanks @GaryMarksBigladder |
| void ShowDetailedSevereItemNotFound(EnergyPlusData& state, ErrorObjectHeader const& eoh, std::string_view fieldName, std::string_view fieldVal) | ||
| { | ||
| ShowSevereError(state, format("{}: {} = {}, item not found.", eoh.routineName, fieldName, fieldVal)); | ||
| ShowContinueError(state, format("{} = {}, item not found.", fieldName, fieldVal)); |
There was a problem hiding this comment.
I'll be honest - I'm not sure I understand. This is repeating the same line twice? Except in the first it just shows the routine name? That seems odd to me. Maybe I'm missing something.
There was a problem hiding this comment.
ShowSevereItemNotFound:
ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName));
ShowContinueError(state, format("{} = {}, item not found.", fieldName, fieldVal));
|
@Myoldmopar any idea what's happening with the regression error in the CI? It doesn't look like the regression files were uploaded. |
|
The formatting fix (from the static code analysis) can be downloaded from the patch file and shows: A minor quick fix. I'm not sure I understand the other issues being reported on the Build and Test related to a forked repo. When I google that it seems to be pointing to the fact that the pull request is coming from the bigladder repo and maybe there is a permission issue. |
…ub.com/bigladder/EnergyPlus into Fix-11185-Incorrect-Severe-Tariff-Error
|
Formatting fixed! |
…-11185-Incorrect-Severe-Tariff-Error
| /// <summary> | ||
| /// Similar to ShowSevereItemNotFound, except for the severe error added to the list contains the information about | ||
| /// what item is missing. | ||
| /// </summary> | ||
| /// <param name="state">EnergyPus state, used for tracking the severe error</param> | ||
| /// <param name="eoh">Error object header, used to get the routineName</param> | ||
| /// <param name="fieldName">Name of the unmatched field</param> | ||
| /// <param name="fieldValue">Value of the unmatched field</param> | ||
| void ShowDetailedSevereItemNotFound(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); |
There was a problem hiding this comment.
I could see this being pretty useful if we had it propagated throughout the code, but I'm having trouble seeing where this would kick in, and IDD/IDF file validation would end. This is fine to go in... I'm just thinking out loud..
Pull request overview
Description of the purpose of this PR
Missing item severe tariff error doesn't display the missing item and instead displays some default information. The fix adds the item that's missing to the severe error.
Pull Request Author
Reviewer