Rafael H. Schloming commented on PROTON-689:

I added a "Transport.condition" property to access error details. The 
pn_condition_t object is very similar to pn_error_t except rather than a 
numeric code it has a symbolic name and it can also carry a map with additional 
parameters. In python it seems kind of confusing and pointless to have both 
concepts (we should possibly merge them in C also), so I opted to expose the 
error details as a condition rather than an error since pn_condition_t can 
carry the full range of protocol errors and info, whereas pn_error_t cannot.

I don't really know why Connection has an error property. Pretty much anything 
that generates an error should be exposed to the binding via exceptions. I 
commented out the error property and none of the tests failed, so I'm thinking 
we should deprecate the error property on connection and use the Connection's 
condition property instead.

Let me know if what I have added works for you.

> Python binding does not expose transport error details
> ------------------------------------------------------
>                 Key: PROTON-689
>                 URL: https://issues.apache.org/jira/browse/PROTON-689
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>    Affects Versions: 0.8
>            Reporter: Ken Giusti
>             Fix For: 0.8
> The proton event model defines a TRANSPORT_ERROR event, but when the event 
> occurs there is no way to extract the error code nor the error text from the 
> transport when using the python binding.
> The connection class exports the error code via the 'error' property.  I'd 
> like to see an 'error' property added to the Transport class, and an 
> 'error_text' property to both the Transport and the Connection for 
> completeness.

This message was sent by Atlassian JIRA

Reply via email to