fix(flight controller): fix issue #407#427
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances error handling in the flight controller module by appending user-friendly guidance to connection error messages.
- The __create_connection_with_retry method is updated to generate more detailed error messages.
- A new __get_connection_error_guidance method has been added to provide tailored guidance for specific error types, such as permission issues on Linux.
Comments suppressed due to low confidence (1)
ardupilot_methodic_configurator/backend_flightcontroller.py:310
- The variable 'os_name' is referenced without being defined. Consider replacing it with 'os.name' after importing the os module or ensure that 'os_name' is defined earlier in the code.
if isinstance(error, PermissionError) and os_name == "posix" and "/dev/" in device:
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
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 #407
This pull request enhances error handling in the
__create_connection_with_retrymethod by providing user-friendly guidance for specific connection errors. The changes aim to improve the debugging experience, especially for common issues like permission errors on Linux systems.Improvements to error handling:
ardupilot_methodic_configurator/backend_flightcontroller.py:__create_connection_with_retrymethod to include additional guidance in the returned error message when a connection error occurs. The guidance is generated based on the error type and device information.__get_connection_error_guidanceto provide tailored guidance for specific error types, such as suggesting the addition of a user to thedialoutgroup for permission errors on Linux.