Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decrypt: Improve error handling #103

Closed
wants to merge 1 commit into from
Closed

decrypt: Improve error handling #103

wants to merge 1 commit into from

Conversation

jodh-intel
Copy link
Member

Enhanced get_plaintext_layer() so that it passes the full error back to the caller, along with error context. This resolves the issue of the method returning a generic "decrypt failed" message. Now, we return something like:

decrypt failed

Caused by:
    missing private key needed for decryption

This change necessitated reworking the tests to assert that the expected error stack / context is checked.

Fixes: #92.

Signed-off-by: James O. D. Hunt [email protected]

Enhanced `get_plaintext_layer()` so that it passes the full error back
to the caller, along with error context. This resolves the issue of the
method returning a generic "decrypt failed" message. Now, we return
something like:

```
decrypt failed

Caused by:
    missing private key needed for decryption
```

This change necessitated reworking the tests to assert that the expected
error stack / context is checked.

Fixes: #92.

Signed-off-by: James O. D. Hunt <[email protected]>
@jodh-intel
Copy link
Member Author

/cc @wainersm. See also #102.

@jiangliu
Copy link
Member

jiangliu commented Jan 5, 2023

It's partially handled by #99 :)

@arronwy
Copy link
Member

arronwy commented Jan 6, 2023

Hi @jodh-intel , could you help rebase this PR against lastest main branch since #99 is just merged?

@jodh-intel
Copy link
Member Author

Hi @jiangliu and @arronwy - I'm not sure it's worth rebasing given all the changes introduced by #99. But let's wait to see what @wainersm thinks. #99 doesn't specify that it resolves #92, but if it does, I'll close this PR.

@jodh-intel
Copy link
Member Author

Any thoughts folks?

@jodh-intel jodh-intel closed this by deleting the head repository Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

decrypt: improve the error message when decryption fail
3 participants