-
Notifications
You must be signed in to change notification settings - Fork 460
Creation of Error Message for When ZoneControl:Thermostat Refers to Invalid ThermostatSetpoint:* Object #11127
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
Creation of Error Message for When ZoneControl:Thermostat Refers to Invalid ThermostatSetpoint:* Object #11127
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
|
@RKStrand I took the liberty to expand on the warning message. |
rraustad
left a comment
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.
This looks good and works as expected.
|
Thanks, @rraustad! Always open to improvements--this looks good. 😁 |
|
|
||
| EXPECT_TRUE(compare_err_stream_substring("ZoneControl:Thermostat = ANOTHERZONE THERMOSTAT, control name = THISISINVALID was not found in " | ||
| "ThermostatSetpoint object type = ThermostatSetpoint:SingleHeating.", | ||
| true)); |
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.
Yes yes yes, substring check! 💯
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