Skip to content

fix(flight controller): fix issue #407#427

Merged
amilcarlucas merged 1 commit into
masterfrom
fix_407
Apr 21, 2025
Merged

fix(flight controller): fix issue #407#427
amilcarlucas merged 1 commit into
masterfrom
fix_407

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

Closes #407

This pull request enhances error handling in the __create_connection_with_retry method 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:
    • Modified the __create_connection_with_retry method 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.
    • Added a new private method __get_connection_error_guidance to provide tailored guidance for specific error types, such as suggesting the addition of a user to the dialout group for permission errors on Linux.

Copilot AI review requested due to automatic review settings April 21, 2025 17:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

@github-actions
Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
6142 4028 66% 60% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/backend_flightcontroller.py 41% 🟢
TOTAL 41% 🟢

updated for commit: af9ad29 by action🐍

@amilcarlucas amilcarlucas merged commit 0545496 into master Apr 21, 2025
18 of 20 checks passed
@amilcarlucas amilcarlucas deleted the fix_407 branch April 21, 2025 19:14
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.

Document Linux permissions for connecting to the autopilot

2 participants