-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
PDBIOException re-raised ValueError with obfuscating message #4729
Comments
You're getting both exceptions with an unmodified Biopython, right? Rather than this: raise PDBIOException(
f"Error when writing atom {atom.full_id}"
) from err would you prefer: raise PDBIOException(
f"Error when writing atom {atom.full_id}: {err}"
) from err or with a single exception: raise PDBIOException(
f"Error when writing atom {atom.full_id}: {err}"
) from None Or there may be another way to improve this. @etal or @JoaoRodrigues ? |
Thanks for responding so promptly, @peterjc. Yes, the biopython library I use is unmodified. Additional information I forgot to mention:
Since the root cause of the error is made explicit in the initial
It should not be lost. So yes, propagating its message into a The following modification would improve the
|
Thanks for reporting @CatChenal, I'll have a look this weekend. This doesn't seem great.. |
Setup
I am reporting a problem with Biopython version, Python version, and operating
system as follows:
Expected behaviour
The final error message — after re-raising a ValueError as a PDBIOException — is :
While the error message of its source is:
So, contrary to the comment at PDBIO.save:L390 (see traceback), the "caught" exception message is LESS informative than the original one.
Actual behaviour
The traceback shows the original error message was more informative:
Steps to reproduce
The text was updated successfully, but these errors were encountered: