Creation of Error Message for When ZoneControl:Thermostat Refers to Invalid ThermostatSetpoint:* Object#11127
Merged
Myoldmopar merged 4 commits intodevelopfrom Aug 13, 2025
Conversation
Added a trap/error to avoid a hard crash when a user either enters a blank or a non-valid control name in the ZoneControl:Thermostat object. New code avoids the hard crash when the index is zero and provides users with an error message that points toward the path for correcting the issue.
A unit test was added to test the presence of an invalid thermostat object. Here, an error is purposely put in the input where a ZoneControl:Thermostat tries to access a single heating setpoint definition that does not exist. This verifies that an error is flagged. Before the fix, this was simply a hard crash.
…22ZoneControlThermostatMissingThermostatSetpointObject
Collaborator
|
@RKStrand I took the liberty to expand on the warning message. |
rraustad
approved these changes
Jul 29, 2025
Collaborator
rraustad
left a comment
There was a problem hiding this comment.
This looks good and works as expected.
Contributor
Author
|
Thanks, @rraustad! Always open to improvements--this looks good. 😁 |
Myoldmopar
approved these changes
Aug 13, 2025
|
|
||
| EXPECT_TRUE(compare_err_stream_substring("ZoneControl:Thermostat = ANOTHERZONE THERMOSTAT, control name = THISISINVALID was not found in " | ||
| "ThermostatSetpoint object type = ThermostatSetpoint:SingleHeating.", | ||
| true)); |
Member
There was a problem hiding this comment.
Yes yes yes, substring check! 💯
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request overview
Description of the purpose of this PR
A user file had a ZoneControl:Thermostat object which referred to a ThermostatSetpoint:* object that did not exist anywhere in the input file. As a result, the find index came back as zero which led to a hard crash due to an improper array index. The fix traps when this happens and issues a severe/fatal error describing what is wrong/what to fix while avoiding the hard crash. A unit test demonstrates this input situation and properly shows that this situation leads to the new error message. No differences are expected in the output since this fixes a bug that caused a hard crash and no files in the test suite actually crash.
Pull Request Author
Reviewer