{"url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/377","id":3443854707,"node_id":"PR_kwDOAjeFf87NRQ1z","html_url":"https://github.com/OpenCyphal/pycyphal/pull/377","diff_url":"https://github.com/OpenCyphal/pycyphal/pull/377.diff","patch_url":"https://github.com/OpenCyphal/pycyphal/pull/377.patch","issue_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/377","number":377,"state":"closed","locked":false,"title":"Add option to hook into internal pycyphal errors","user":{"login":"LukasLendvorsky","id":878316,"node_id":"MDQ6VXNlcjg3ODMxNg==","avatar_url":"https://avatars.githubusercontent.com/u/878316?v=4","gravatar_id":"","url":"https://api.github.com/users/LukasLendvorsky","html_url":"https://github.com/LukasLendvorsky","followers_url":"https://api.github.com/users/LukasLendvorsky/followers","following_url":"https://api.github.com/users/LukasLendvorsky/following{/other_user}","gists_url":"https://api.github.com/users/LukasLendvorsky/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasLendvorsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasLendvorsky/subscriptions","organizations_url":"https://api.github.com/users/LukasLendvorsky/orgs","repos_url":"https://api.github.com/users/LukasLendvorsky/repos","events_url":"https://api.github.com/users/LukasLendvorsky/events{/privacy}","received_events_url":"https://api.github.com/users/LukasLendvorsky/received_events","type":"User","user_view_type":"public","site_admin":false},"body":"Currently, when pycyphal encounters an error in one of its background asyncio tasks (e.g. a task receiving messages in the background), it simply calls logger.exception. This is fine for debugging with a human looking at the logs, but insufficient for production environments where you need to react to unexpected problems — there is no way of knowing an exception happened except by reading the logs.\r\n\r\nThis PR introduces set_internal_error_handler, which can be used to register a global hook into pycyphal. This hook will receive all background exceptions when they happen and can react to them as needed (e.g. by raising a fatal error). When no hook is registered, the behavior is unchanged — exceptions are simply logged.","created_at":"2026-03-25T08:47:33Z","updated_at":"2026-03-26T13:26:49Z","closed_at":"2026-03-25T20:52:34Z","merged_at":"2026-03-25T20:52:34Z","merge_commit_sha":"7b00386c524afd4a9eba08d39733469f3fb13863","assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/377/commits","review_comments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/377/comments","review_comment_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/377/comments","statuses_url":"https://api.github.com/repos/OpenCyphal/pycyphal/statuses/e0963d2335abefe272bae5f10ace7952392ec960","head":{"label":"LukasLendvorsky:error_reporting_pr","ref":"error_reporting_pr","sha":"e0963d2335abefe272bae5f10ace7952392ec960","user":{"login":"LukasLendvorsky","id":878316,"node_id":"MDQ6VXNlcjg3ODMxNg==","avatar_url":"https://avatars.githubusercontent.com/u/878316?v=4","gravatar_id":"","url":"https://api.github.com/users/LukasLendvorsky","html_url":"https://github.com/LukasLendvorsky","followers_url":"https://api.github.com/users/LukasLendvorsky/followers","following_url":"https://api.github.com/users/LukasLendvorsky/following{/other_user}","gists_url":"https://api.github.com/users/LukasLendvorsky/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasLendvorsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasLendvorsky/subscriptions","organizations_url":"https://api.github.com/users/LukasLendvorsky/orgs","repos_url":"https://api.github.com/users/LukasLendvorsky/repos","events_url":"https://api.github.com/users/LukasLendvorsky/events{/privacy}","received_events_url":"https://api.github.com/users/LukasLendvorsky/received_events","type":"User","user_view_type":"public","site_admin":false},"repo":{"id":1013829285,"node_id":"R_kgDOPG3OpQ","name":"pycyphal","full_name":"LukasLendvorsky/pycyphal","private":false,"owner":{"login":"LukasLendvorsky","id":878316,"node_id":"MDQ6VXNlcjg3ODMxNg==","avatar_url":"https://avatars.githubusercontent.com/u/878316?v=4","gravatar_id":"","url":"https://api.github.com/users/LukasLendvorsky","html_url":"https://github.com/LukasLendvorsky","followers_url":"https://api.github.com/users/LukasLendvorsky/followers","following_url":"https://api.github.com/users/LukasLendvorsky/following{/other_user}","gists_url":"https://api.github.com/users/LukasLendvorsky/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasLendvorsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasLendvorsky/subscriptions","organizations_url":"https://api.github.com/users/LukasLendvorsky/orgs","repos_url":"https://api.github.com/users/LukasLendvorsky/repos","events_url":"https://api.github.com/users/LukasLendvorsky/events{/privacy}","received_events_url":"https://api.github.com/users/LukasLendvorsky/received_events","type":"User","user_view_type":"public","site_admin":false},"html_url":"https://github.com/LukasLendvorsky/pycyphal","description":"Python implementation of the Cyphal protocol stack.","fork":true,"url":"https://api.github.com/repos/LukasLendvorsky/pycyphal","forks_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/forks","keys_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/teams","hooks_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/hooks","issue_events_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/issues/events{/number}","events_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/events","assignees_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/assignees{/user}","branches_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/branches{/branch}","tags_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/tags","blobs_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/git/refs{/sha}","trees_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/statuses/{sha}","languages_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/languages","stargazers_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/stargazers","contributors_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/contributors","subscribers_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/subscribers","subscription_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/subscription","commits_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/commits{/sha}","git_commits_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/git/commits{/sha}","comments_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/comments{/number}","issue_comment_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/issues/comments{/number}","contents_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/contents/{+path}","compare_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/merges","archive_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/downloads","issues_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/issues{/number}","pulls_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/pulls{/number}","milestones_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/milestones{/number}","notifications_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/labels{/name}","releases_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/releases{/id}","deployments_url":"https://api.github.com/repos/LukasLendvorsky/pycyphal/deployments","created_at":"2025-07-04T14:32:02Z","updated_at":"2025-07-04T14:32:02Z","pushed_at":"2026-03-26T13:26:48Z","git_url":"git://github.com/LukasLendvorsky/pycyphal.git","ssh_url":"git@github.com:LukasLendvorsky/pycyphal.git","clone_url":"https://github.com/LukasLendvorsky/pycyphal.git","svn_url":"https://github.com/LukasLendvorsky/pycyphal","homepage":"https://pycyphal.readthedocs.io/","size":89959,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":[],"visibility":"public","forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenCyphal:master","ref":"master","sha":"58c356e39b3539942a5533410907712958f57c67","user":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"repo":{"id":37193087,"node_id":"MDEwOlJlcG9zaXRvcnkzNzE5MzA4Nw==","name":"pycyphal","full_name":"OpenCyphal/pycyphal","private":false,"owner":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"html_url":"https://github.com/OpenCyphal/pycyphal","description":"Python implementation of the Cyphal protocol stack.","fork":false,"url":"https://api.github.com/repos/OpenCyphal/pycyphal","forks_url":"https://api.github.com/repos/OpenCyphal/pycyphal/forks","keys_url":"https://api.github.com/repos/OpenCyphal/pycyphal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenCyphal/pycyphal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenCyphal/pycyphal/teams","hooks_url":"https://api.github.com/repos/OpenCyphal/pycyphal/hooks","issue_events_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/events{/number}","events_url":"https://api.github.com/repos/OpenCyphal/pycyphal/events","assignees_url":"https://api.github.com/repos/OpenCyphal/pycyphal/assignees{/user}","branches_url":"https://api.github.com/repos/OpenCyphal/pycyphal/branches{/branch}","tags_url":"https://api.github.com/repos/OpenCyphal/pycyphal/tags","blobs_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenCyphal/pycyphal/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenCyphal/pycyphal/languages","stargazers_url":"https://api.github.com/repos/OpenCyphal/pycyphal/stargazers","contributors_url":"https://api.github.com/repos/OpenCyphal/pycyphal/contributors","subscribers_url":"https://api.github.com/repos/OpenCyphal/pycyphal/subscribers","subscription_url":"https://api.github.com/repos/OpenCyphal/pycyphal/subscription","commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenCyphal/pycyphal/contents/{+path}","compare_url":"https://api.github.com/repos/OpenCyphal/pycyphal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenCyphal/pycyphal/merges","archive_url":"https://api.github.com/repos/OpenCyphal/pycyphal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenCyphal/pycyphal/downloads","issues_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues{/number}","pulls_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenCyphal/pycyphal/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenCyphal/pycyphal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenCyphal/pycyphal/labels{/name}","releases_url":"https://api.github.com/repos/OpenCyphal/pycyphal/releases{/id}","deployments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/deployments","created_at":"2015-06-10T11:27:27Z","updated_at":"2026-04-12T09:08:25Z","pushed_at":"2026-04-12T11:57:35Z","git_url":"git://github.com/OpenCyphal/pycyphal.git","ssh_url":"git@github.com:OpenCyphal/pycyphal.git","clone_url":"https://github.com/OpenCyphal/pycyphal.git","svn_url":"https://github.com/OpenCyphal/pycyphal","homepage":"https://opencyphal.github.io/pycyphal","size":90366,"stargazers_count":134,"watchers_count":134,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"has_discussions":false,"forks_count":108,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":["aerospace","can","can-bus","communication-protocol","cross-platform","cyphal","development-tools","drones","hacktoberfest","linux","opencyphal","python","python-3","python3","robotics","socketcan","space","uav","uavcan"],"visibility":"public","forks":108,"open_issues":12,"watchers":134,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/377"},"html":{"href":"https://github.com/OpenCyphal/pycyphal/pull/377"},"issue":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/377"},"comments":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/377/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/377/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/377/commits"},"statuses":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/statuses/e0963d2335abefe272bae5f10ace7952392ec960"}},"author_association":"CONTRIBUTOR","auto_merge":null,"assignee":null,"active_lock_reason":null,"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"pavel-kirienko","id":3298404,"node_id":"MDQ6VXNlcjMyOTg0MDQ=","avatar_url":"https://avatars.githubusercontent.com/u/3298404?v=4","gravatar_id":"","url":"https://api.github.com/users/pavel-kirienko","html_url":"https://github.com/pavel-kirienko","followers_url":"https://api.github.com/users/pavel-kirienko/followers","following_url":"https://api.github.com/users/pavel-kirienko/following{/other_user}","gists_url":"https://api.github.com/users/pavel-kirienko/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-kirienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-kirienko/subscriptions","organizations_url":"https://api.github.com/users/pavel-kirienko/orgs","repos_url":"https://api.github.com/users/pavel-kirienko/repos","events_url":"https://api.github.com/users/pavel-kirienko/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-kirienko/received_events","type":"User","user_view_type":"public","site_admin":false},"comments":2,"review_comments":11,"maintainer_can_modify":false,"commits":4,"additions":195,"deletions":43,"changed_files":27}