[
https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13435131#comment-13435131
]
Rafael H. Schloming commented on PROTON-1:
------------------------------------------
Ok, going over this one with a less congested head, I've noticed an issue. The
%contract stuff is great for making exceptions occur, but at least for things
like checking return error codes it seems to swallow the actual reason for the
exception, e.g.:
File "/home/rhs/bin/proton-test", line 331, in run
phase()
File "/home/rhs/proton/tests/proton_tests/messenger.py", line 93, in
testSendBogus
pn_messenger_put(self.client, msg)
RuntimeError: Contract violation: ensure: (result==0)
I think this is a problem given that things like, pn_messenger_send returns an
error code which indicates what has actually gone wrong, and there is a big
difference between say a PN_TIMEOUT (indicates that send has blocked for longer
than the timeout set for the messenger, not necessarily an error per/se), and
PN_STATE_ERR, (indicates the messenger is in some kind of illegal state).
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
> Key: PROTON-1
> URL: https://issues.apache.org/jira/browse/PROTON-1
> Project: Qpid Proton
> Issue Type: Bug
> Reporter: Darryl L. Pierce
> Attachments:
> 0001-Provides-contract-guarantees-to-language-bindings.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the
> pre- and post-conditions for the APIs. For any language binding, when such a
> condition is not met then a runtime exception is raised.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira