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

How to Retrieve msg Attribute from a Caught ClientError Exception #47

Open
chaohui2 opened this issue Jan 10, 2024 · 0 comments
Open

How to Retrieve msg Attribute from a Caught ClientError Exception #47

chaohui2 opened this issue Jan 10, 2024 · 0 comments

Comments

@chaohui2
Copy link

Hello,

I am currently working with the pyactiveresource package and have encountered a situation where I need to extract the msg attribute from a ClientError exception. I understand that this attribute should contain detailed information about the error. However, I am unsure about the correct method to access this attribute. Here is a snippet of my code:

python
Copy code
from pyactiveresource.connection import ClientError

try:
    # Code that might throw ClientError
    ...
except ClientError as e:
    # Attempt to access the 'msg' attribute
    error_message = e.msg
    print(error_message)
    

In this code, I'm trying to catch the ClientError and then access its msg attribute. Could you please provide guidance or an example on how to properly retrieve the msg attribute from a ClientError exception in pyactiveresource?

Thank you for your assistance and for the development of this useful library.

Best regards

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

No branches or pull requests

1 participant