{"id":15521048,"url":"https://github.com/sloev/error_scope_context_manager","last_synced_at":"2025-03-09T22:45:44.675Z","repository":{"id":142330269,"uuid":"351072518","full_name":"sloev/error_scope_context_manager","owner":"sloev","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-24T12:35:58.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T11:15:33.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sloev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-24T12:31:38.000Z","updated_at":"2021-03-24T12:36:01.000Z","dependencies_parsed_at":"2023-06-03T04:15:43.633Z","dependency_job_id":null,"html_url":"https://github.com/sloev/error_scope_context_manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloev%2Ferror_scope_context_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloev%2Ferror_scope_context_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloev%2Ferror_scope_context_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloev%2Ferror_scope_context_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sloev","download_url":"https://codeload.github.com/sloev/error_scope_context_manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242762744,"owners_count":20181266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T10:31:57.077Z","updated_at":"2025-03-09T22:45:44.663Z","avatar_url":"https://github.com/sloev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scope that gathers information about its inner errors\n\nsometimes its useful to yield information about certain actions to be taken when you know about them at the origin of an error.\n\nThis repo contains a [error_scope module](./error_scope.py) that creates a context manager that gathers intel about events occuring in its inner scope and returns information about it afterwards\n\n## usage\n\nexample (full code [here](./test.py)):\n\n```python\nimport logging\n\nfrom error_scope import gather_errors\nfrom sub_module import main\n\nwith gather_errors() as seen_actions:\n    try:\n        main()\n    except:\n        logging.exception(\"error\")\n    finally:\n        print(\"\\ngot seen_actions from gather_errors...:\", seen_actions)\n\n```\n\noutput:\n\n```bash\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionBadDataFormat: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionReauthNeeded: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionBadDataFormat: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionReauthNeeded: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionBadDataFormat: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionReauthNeeded: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionBadDataFormat: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionReauthNeeded: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionBadDataFormat: raising error here\nERROR:root:I survived that error\nTraceback (most recent call last):\n  File \"PATHsub_module.py\", line 10, in main\n    raise exc_cls(\"raising error here\")\nerror_scope.ActionReauthNeeded: raising error here\n\ngot seen_actions from gather_errors...: ['bad_data_format', 'reauth_needed']\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloev%2Ferror_scope_context_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsloev%2Ferror_scope_context_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloev%2Ferror_scope_context_manager/lists"}