Skip to content

Conversation

@0x676e67
Copy link
Owner

No description provided.

@0x676e67 0x676e67 merged commit 5bd789f into main Dec 20, 2025
32 checks passed
@0x676e67 0x676e67 deleted the error branch December 20, 2025 03:56
@0x676e67
Copy link
Owner Author

@gemini-code-assist

@gemini-code-assist
Copy link

Hello! You tagged me, but didn't specify a command. If you'd like me to perform a code review or provide a summary of this pull request, please use one of the following commands:

  • /gemini review: Performs a code review for the current pull request.
  • /gemini summary: Provides a summary of the current pull request.

For a full list of commands and more information, you can always use /gemini help.

@0x676e67
Copy link
Owner Author

/gemini review

@0x676e67
Copy link
Owner Author

/gemini summary

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new ProxyConnectionError to handle errors related to proxy connections. The changes are well-contained, touching the Python exception definitions, the Rust error mapping, and adding a new test file. My review suggests two main improvements. First, for better API design and user experience, ProxyConnectionError should inherit from ConnectionError. Second, the new test can be made more robust and readable using pytest.mark.parametrize. An important point to address is that the new ProxyConnectionError is missing from the __all__ list in python/rnet/exceptions.py, which will prevent it from being correctly exported and imported via * imports.

@gemini-code-assist
Copy link

Summary of Changes

This pull request enhances the error handling capabilities by introducing a dedicated ProxyConnectionError. This new exception provides more granular feedback for network operations that fail specifically due to proxy-related issues, such as invalid proxy addresses, unreachable servers, or authentication failures. The change includes defining the exception in Python, integrating it with the Rust core for proper error mapping, and adding a robust test suite to ensure its correct behavior across different proxy types and URLs.

Highlights

  • New Proxy Connection Error: Introduced ProxyConnectionError in python/rnet/exceptions.py to specifically handle issues when connecting via a proxy server.
  • Rust Integration: The new ProxyConnectionError is registered and mapped in the Rust backend (src/error.rs and src/lib.rs) to ensure proper propagation from Rust to Python.
  • Comprehensive Testing: A new test file (tests/error_test.py) has been added to validate that ProxyConnectionError is correctly raised for various invalid proxy configurations.
Changelog
  • python/rnet/exceptions.py
    • Defined a new ProxyConnectionError class with a detailed docstring outlining its purpose and common causes.
  • src/error.rs
    • Registered ProxyConnectionError as a Python exception.
    • Mapped is_proxy_connect to ProxyConnectionError in the From<Error> for PyErr implementation.
  • src/lib.rs
    • Added ProxyConnectionError to the exceptions_module for Python accessibility.
  • tests/error_test.py
    • Added a new test file containing test_proxy_connection_error to verify the new exception is raised when using invalid proxy configurations.
Activity
  • Author 0x676e67 initiated interaction with gemini-code-assist.
  • gemini-code-assist[bot] responded, requesting a specific command.
  • Author 0x676e67 requested a code review.
  • Author 0x676e67 requested a summary.
  • gemini-code-assist[bot] suggested that ProxyConnectionError should inherit from ConnectionError for better exception hierarchy.
  • gemini-code-assist[bot] recommended refactoring the new test case in tests/error_test.py to use pytest.mark.parametrize.

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.

2 participants