Skip to content

Fix JSONDecodeError crash in config flow direction step#3

Draft
google-labs-jules[bot] wants to merge 3 commits intomainfrom
bugfix/handle-json-decode-error-5278288494775205294
Draft

Fix JSONDecodeError crash in config flow direction step#3
google-labs-jules[bot] wants to merge 3 commits intomainfrom
bugfix/handle-json-decode-error-5278288494775205294

Conversation

@google-labs-jules
Copy link

Fixes a crash in the configuration flow where an invalid API response (causing a JSONDecodeError) during the direction selection step would result in a traceback. Now, the user is presented with an error message and can retry the stop selection.


PR created automatically by Jules for task 5278288494775205294 started by @azman0101

Wraps API calls for fetching directions in a try-except block to catch `json.JSONDecodeError` and `aiohttp.ClientError`. Redirects user to the stop selection step with an error message instead of crashing.

- Added `json` and `ClientError` imports.
- Updated `async_step_stop` to accept `errors`.
- Updated `async_step_direction` to handle exceptions.
- Added translation keys for error message in EN and FR.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@semanticdiff-com
Copy link

semanticdiff-com bot commented Jan 11, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  custom_components/idfm/translations/fr.json  99% smaller
  custom_components/idfm/translations/en.json  75% smaller
  custom_components/idfm/config_flow.py  69% smaller
  custom_components/idfm/manifest.json  0% smaller
  hacs.json  0% smaller

Wraps API calls for fetching directions in a try-except block to catch `json.JSONDecodeError` and `aiohttp.ClientError`. Redirects user to the stop selection step with an error message instead of crashing.
Also renames the integration to "IDFM Custom" in metadata files.

- Added `json` and `ClientError` imports.
- Updated `async_step_stop` to accept `errors`.
- Updated `async_step_direction` to handle exceptions.
- Added translation keys for error message in EN and FR.
- Updated `hacs.json` and `manifest.json` with new name "IDFM Custom".
Wraps API calls in config flow to catch JSONDecodeError and ClientError, allowing retry.
Updates manifest.json with new code owner (@azman0101) and repository links for the fork.

- Config flow: Handle exceptions during direction fetch.
- Manifest: Update codeowners, docs, and issue tracker links.
- HACS: Update name to IDFM Custom.
- Translations: Add error messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants