podman-py icon indicating copy to clipboard operation
podman-py copied to clipboard

feat: Enhance environment connection error handling

Open Mr-Sunglasses opened this issue 9 months ago β€’ 6 comments

fix: #455

Add PodmanConnectionError to improve debugging of connection failures when initializing client from environment variables. The new error provides:

  • Detailed error messages with connection host and environment state
  • Preservation of original exception information
  • Better context for common failure modes (invalid config, connection failures)

Previously, raw exceptions from connection attempts could be confusing to diagnose, especially when involving environment variables. This change makes it clearer what went wrong during client initialization.

Mr-Sunglasses avatar Feb 16 '25 16:02 Mr-Sunglasses

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Mr-Sunglasses Once this PR has been reviewed and has the lgtm label, please assign umohnani8 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Feb 16 '25 16:02 openshift-ci[bot]

Hey @inknos , I've fixed all the suggested changes on PR: #472 in this PR because that was messed up and thanks @D3vil0p3r for your suggestion, I really helped me in resolving this issue.

Mr-Sunglasses avatar Feb 16 '25 16:02 Mr-Sunglasses

Thanks, I'll look into it. Since the first time you committed, many things have changed in the codebase and we reformatted and dropped quite a lot of old code. I'll help you with this to fix the remaining issues. it should be a matter of passing the lint and few other things :)

inknos avatar Feb 17 '25 14:02 inknos

Thanks, I'll look into it. Since the first time you committed, many things have changed in the codebase and we reformatted and dropped quite a lot of old code. I'll help you with this to fix the remaining issues. it should be a matter of passing the lint and few other things :)

Sure thanks @inknos , looking forward to your review and also happy to resolve more bugs πŸ˜„

Mr-Sunglasses avatar Feb 17 '25 16:02 Mr-Sunglasses

hey. @Mr-Sunglasses I was working on https://github.com/containers/podman-py/pull/510 to fix the tests flake that hit the packit jobs, and now they should be good (it was about the infinite running tests). I also published 5.4.0 within the same PR and that should fix all the red lights 🀞🏻 . you might want to pull main, rebase and push your commits again :)

inknos avatar Feb 19 '25 08:02 inknos

hey. @Mr-Sunglasses I was working on #510 to fix the tests flake that hit the packit jobs, and now they should be good (it was about the infinite running tests). I also published 5.4.0 within the same PR and that should fix all the red lights 🀞🏻 . you might want to pull main, rebase and push your commits again :)

Sure @inknos thanks a lot, it'll do that right away :-)

Let's hope for the best that all tests pass 🧿🀞🏻

Mr-Sunglasses avatar Feb 19 '25 09:02 Mr-Sunglasses