improve messages#3342
Draft
LKuemmel wants to merge 3 commits intoopenWB:masterfrom
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates user- and log-facing German error messages around hardware checks and error handling to be shorter/simplified, and adjusts tests accordingly.
Changes:
- Shortened/rewrote hardware-check error message constants and removed the appended “Support kontaktieren” hint from raised exceptions/warnings.
- Updated hardware check tests to match the new exception messages.
- Simplified
ErrorTimerContextlogging by removing the long internal hint and logging only the exception message.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/modules/common/hardware_check.py | Rewrites hardware-check message constants and changes raised exception/warning texts to no longer append the support hint. |
| packages/modules/common/hardware_check_test.py | Updates expected exception messages to match the new strings. |
| packages/helpermodules/utils/error_handling.py | Removes the internal hint text and changes error logging behavior in ErrorTimerContext.__exit__. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| USB_ADAPTER_BROKEN = RS485_ADAPTER_BROKEN.format('USB-Adapters') | ||
| LAN_ADAPTER_BROKEN = RS485_ADAPTER_BROKEN.format('LAN-Konverters') | ||
| METER_PROBLEM = "Erneutes Auslesen des Zählers" | ||
| METER_BROKEN_VOLTAGES = "Erneutes Auslesen der Spannungen am Zähler" |
| return False | ||
| else: | ||
| log.error(f"{exception}\n{INTERNAL_ERROR_HINT}") | ||
| log.error(exception) |
| id="EVSE defekt"), | ||
| pytest.param(Exception("Modbus"), None, [230, 0, 230], None, False, ModbusSerialClient_, | ||
| EVSE_BROKEN + " " + METER_BROKEN_VOLTAGES.format([230, 0, 230]) + OPEN_TICKET, | ||
| EVSE_BROKEN + " " + METER_BROKEN_VOLTAGES.format([230, 0, 230]), |
| raise Exception(USB_ADAPTER_BROKEN) | ||
| else: | ||
| raise Exception(meter_error_msg + OPEN_TICKET) | ||
| raise Exception(meter_error_msg) |
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.
No description provided.