Skip to content

Conversation

@rongxin-liu
Copy link
Contributor

@rongxin-liu rongxin-liu commented Aug 8, 2025

This PR implements a fallback mechanism that:

  1. Primary attempt: Makes the initial request to https://github.com/{org}/{repo}/raw/{branch}/{filepath} as before
  2. Fallback on 404: If the primary URL returns a 404, automatically retry with the direct raw URL: https://raw.githubusercontent.com/{org}/{repo}/{branch}/{filepath}

@rongxin-liu rongxin-liu self-assigned this Aug 8, 2025
@rongxin-liu rongxin-liu added the enhancement New feature or request label Aug 8, 2025
@rongxin-liu rongxin-liu merged commit 64110a2 into develop Aug 8, 2025
1 check passed
@rongxin-liu rongxin-liu deleted the feat/issue-97-try-fallback-raw-url branch August 8, 2025 14:08
@rongxin-liu rongxin-liu linked an issue Aug 8, 2025 that may be closed by this pull request

def _handle_ssl_error(e):
"""Handle SSL errors consistently."""
raise ConnectionError(_(f"Could not connect to GitHub due to a SSL error.\nPlease check GitHub's status at githubstatus.com.\nError: {e}"))
Copy link
Member

Choose a reason for hiding this comment

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

More likely TLS nowadays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add fallback URL support for GitHub content retrieval

3 participants