René's URL Explorer Experiment


Title: Refactor error handling code · Issue #138 · josegonzalez/python-github-backup · GitHub

Open Graph Title: Refactor error handling code · Issue #138 · josegonzalez/python-github-backup

X Title: Refactor error handling code · Issue #138 · josegonzalez/python-github-backup

Description: As I was working on writing new error handling code for release asset downloading and trying to reuse the existing error handling for that purpose, I noticed that the _get_response and associated functions seem to need some significant r...

Open Graph Description: As I was working on writing new error handling code for release asset downloading and trying to reuse the existing error handling for that purpose, I noticed that the _get_response and associated f...

X Description: As I was working on writing new error handling code for release asset downloading and trying to reuse the existing error handling for that purpose, I noticed that the _get_response and associated f...

Opengraph URL: https://github.com/josegonzalez/python-github-backup/issues/138

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Refactor error handling code","articleBody":"As I was working on writing new error handling code for release asset downloading and trying to reuse the existing error handling for that purpose, I noticed that the `_get_response` and associated functions seem to need some significant refactoring.\r\n\r\nFor example, it looks like they were meant to be written to collect errors during the retry process, but that's not how they're being used in practice.\r\n\r\nFor example `_request_http_error` takes in an errors list which is also returns, but it never actually adds any errors to it. Then in `_get_response`, there is also an errors array (which is passes to `_request_http_error` presumably to collect any errors) and also returns, but it never gets added to there either.\r\n\r\nThen `_request_url_error` (which is called whenever a URLError or socket.error happens in `_get_response`) calls log_error which immediately exits the script before it can return. Then if it could return, `_get_response` would immediately raise an exception which is not caught, so the script would die before any error handling could happen anyway.\r\n\r\nDue to this, there are many cases of errors that should be recoverable that will kill the script, which isn't great if using it as a \"set it and forget it\" cron job.\r\n\r\nI started refactoring the asset downloading to share those same error handling functions, but then those needed refactoring, which meant `retrieve_data_gen` needed refactoring (it seems the real error handling is actually happening there right now in the cases the script doesn't die first).\r\n\r\nI'm going to put this aside for the moment so I can look at it with a fresh head later and work on one of the other simpler tickets I posted for the time being then come back to this.\r\n\r\nIdeally, after refactoring this to better handle errors, a command line switch (maybe something like `--strict-error-handling` or something) should be added to allows users to choose to exit on errors if they want while defaulting to gracefully handling errors, logging what failed, and continuing. To help with that, it may also be worthwhile generating a separate error log file that is stored somewhere that includes only failed items so they can be retried.\r\n\r\nAlso as mentioned in https://github.com/josegonzalez/python-github-backup/issues/73, we should no longer log empty wikis as warnings/errors as it gives the impression of errors when in reality there was no error (it just tried to clone the wiki and it didn't exist, not that it failed to clone a repo).\r\n\r\nRelated to https://github.com/josegonzalez/python-github-backup/issues/129, https://github.com/josegonzalez/python-github-backup/issues/110, and https://github.com/josegonzalez/python-github-backup/pull/130\r\n\r\nAlso likely related to https://github.com/josegonzalez/python-github-backup/issues/140","author":{"url":"https://github.com/einsteinx2","@type":"Person","name":"einsteinx2"},"datePublished":"2020-01-07T14:08:03Z","url":"https://github.com/josegonzalez/python-github-backup/issues/138"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7b6a1bbe-999e-c60e-18c1-b3a997204978
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCF00:3D78AF:24033C:309D94:6B05DCDA
html-safe-nonce56b79fec84d6b39ac86802d95524308d293f36fabc90162b61e2a571f997d8c1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjAwOjNENzhBRjoyNDAzM0M6MzA5RDk0OjZCMDVEQ0RBIiwidmlzaXRvcl9pZCI6Ijg0NDA0MzEzODY0MjY3Mjc2NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8d3cf69723d1b47e0f7ec9656dad33bdd83b08ab3b1fc1340fd9087c83dd4e56
hovercard-subject-tagissue:546303406
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/josegonzalez/python-github-backup/138/issue_layout
twitter:imagehttps://opengraph.githubassets.com/96469f72b773f2660833d597cc9a80865165521be4f64a3857be9640252dd774/josegonzalez/python-github-backup/issues/138
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/96469f72b773f2660833d597cc9a80865165521be4f64a3857be9640252dd774/josegonzalez/python-github-backup/issues/138
og:image:altAs I was working on writing new error handling code for release asset downloading and trying to reuse the existing error handling for that purpose, I noticed that the _get_response and associated f...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameeinsteinx2
hostnamegithub.com
expected-hostnamegithub.com
Noneab9d6b164c6e5b32656ef80f1a302b2dafee4e4c9360ef3fced66da06fb522fa
turbo-cache-controlno-preview
go-importgithub.com/josegonzalez/python-github-backup git https://github.com/josegonzalez/python-github-backup.git
octolytics-dimension-user_id65675
octolytics-dimension-user_loginjosegonzalez
octolytics-dimension-repository_id14876085
octolytics-dimension-repository_nwojosegonzalez/python-github-backup
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id14876085
octolytics-dimension-repository_network_root_nwojosegonzalez/python-github-backup
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2db8c3558610af6beef9310dcf5537e201a6e5fb
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/josegonzalez/python-github-backup/issues/138#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjosegonzalez%2Fpython-github-backup%2Fissues%2F138
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjosegonzalez%2Fpython-github-backup%2Fissues%2F138
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=josegonzalez%2Fpython-github-backup
Reloadhttps://github.com/josegonzalez/python-github-backup/issues/138
Reloadhttps://github.com/josegonzalez/python-github-backup/issues/138
Reloadhttps://github.com/josegonzalez/python-github-backup/issues/138
josegonzalezhttps://github.com/josegonzalez
python-github-backuphttps://github.com/josegonzalez/python-github-backup
Codehttps://github.com/josegonzalez/python-github-backup
Issues6 (6)https://github.com/josegonzalez/python-github-backup/issues
Pull requests1 (1)https://github.com/josegonzalez/python-github-backup/pulls
Actionshttps://github.com/josegonzalez/python-github-backup/actions
Security and qualityhttps://github.com/josegonzalez/python-github-backup/security
Insightshttps://github.com/josegonzalez/python-github-backup/pulse
https://github.com/josegonzalez/python-github-backup
New issuehttps://github.com/login?return_to=https://github.com/josegonzalez/python-github-backup/issues/138
New issuehttps://github.com/login?return_to=https://github.com/josegonzalez/python-github-backup/issues/138
Refactor error handling codehttps://github.com/josegonzalez/python-github-backup/issues/138#top
https://github.com/einsteinx2
einsteinx2https://github.com/einsteinx2
on Jan 7, 2020https://github.com/josegonzalez/python-github-backup/issues/138#issue-546303406
#73https://github.com/josegonzalez/python-github-backup/issues/73
#129https://github.com/josegonzalez/python-github-backup/issues/129
#110https://github.com/josegonzalez/python-github-backup/issues/110
#130https://github.com/josegonzalez/python-github-backup/pull/130
#140https://github.com/josegonzalez/python-github-backup/issues/140
Iamrodoshttps://github.com/Iamrodos
on Dec 16, 2025https://github.com/josegonzalez/python-github-backup/issues/138#event-21589471961
Fix retry logic for HTTP 5xx errors and network failureshttps://github.com/Iamrodos/python-github-backup/commit/bbac9406d3caab6cfd0bfd8dc074ed5dfa8c3be8
bbac940https://github.com/Iamrodos/python-github-backup/commit/bbac9406d3caab6cfd0bfd8dc074ed5dfa8c3be8
Fix retry logic for HTTP 5xx errors and network failureshttps://github.com/Iamrodos/python-github-backup/commit/46140b0ff13dd512960f42365b35d5ebd011aff6
46140b0https://github.com/Iamrodos/python-github-backup/commit/46140b0ff13dd512960f42365b35d5ebd011aff6
https://github.com/Iamrodos
Iamrodoshttps://github.com/Iamrodos
on Dec 16, 2025https://github.com/josegonzalez/python-github-backup/issues/138#issuecomment-3662376099
@josegonzalezhttps://github.com/josegonzalez
#73https://github.com/josegonzalez/python-github-backup/issues/73
#62https://github.com/josegonzalez/python-github-backup/issues/62
#62https://github.com/josegonzalez/python-github-backup/issues/62
https://github.com/josegonzalez
josegonzalezhttps://github.com/josegonzalez
on Dec 16, 2025https://github.com/josegonzalez/python-github-backup/issues/138#issuecomment-3662396893
josegonzalezhttps://github.com/josegonzalez
completedhttps://github.com/josegonzalez/python-github-backup/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 16, 2025https://github.com/josegonzalez/python-github-backup/issues/138#event-21602386555
Sign up for freehttps://github.com/signup?return_to=https://github.com/josegonzalez/python-github-backup/issues/138
Sign in to commenthttps://github.com/login?return_to=https://github.com/josegonzalez/python-github-backup/issues/138
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.