Repository navigation
Conversation
Opt-in raise_errors raises EmoncmsAuthError on HTTP 401, EmoncmsConnectionError on client errors/timeouts and EmoncmsError otherwise, from async_request and async_input_post. Closes Open-Building-Management#1
This was referenced Nov 14, 2026
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.
Closes #1
Summary
Opt-in
raise_errors=Truemakes the client raise typed exceptions instead of returning{"success": False, ...}. The default behaviour is unchanged.async_get_uuid,async_list_feedsandasync_get_feed_fieldscallasync_request, so they raise too. When raising, the library logs atdebuginstead oferror, leaving error reporting to the caller. This avoids duplicate log lines in Home Assistant (log-when-unavailable).Home Assistant will use this to tell
ConfigEntryAuthFailed(reauth) apart fromConfigEntryNotReady(retry), as required by thetest-before-setup,test-before-configureandreauthentication-flowquality-scale rules.Evidence
main): a bad key and a missing server look identical, and a bad key sends HA users to the "upgrade Emoncms" repair:raise_errors=True):Merge Danger
Door: two-way
The flag is opt-in and defaults to
False. Once released, the exception names become public API that the Home Assistant integration depends on.Blast Radius: minimal
Existing callers keep the dict and
Nonereturns. The one change in default mode is thatasync_input_postnow times out afterrequest_timeout(20 s) instead of waiting indefinitely. The version is bumped to 0.1.4.