According to the code[1], Connector throws an exception when there is no
result set found while searching the users. Not on error in connector. This
seems to be invalid because It should not throw an exception by checking
null. It should set a message and let the message flow continue. Searching
may or may not contains user informations and the message flow should be
decided by the developer, how It continue based on the result. However we
have implemented it in a way that goes to fault sequence on empty result
set and developer has no control.

However It would be better if we can fix this code. To maintain backward
compatibility, we can introduce a property(faultOnEmptyResult) and based on
the property, we can decide whether it goes to fault or continue message
flow. As a default behavior, we can set faultOnEmptyResult to true. Then
existing develpers does not affect this change and backward compatibility



On Mon, Apr 9, 2018 at 2:06 PM, Piriya Sivalingam <pir...@wso2.com> wrote:

> Hi,
> In the LDAP connector, if we encounter any exception [1], it throws the
> synapseException. Hence fault sequence gets triggered. But usually, if
> there is any error in the mediation flow only, the synapseException is
> thrown.
> Could you kindly let me know whether this (throwing synapseException) is
> the expected behavior here.
> If so in order to avoid the messages going into the fault sequence, can we
> handle it with a custom exception handler.
> Could you kindly provide your input on this?
> [1] https://github.com/wso2-extensions/esb-connector-ldap/
> blob/org.wso2.carbon.connector.ldap-1.0.3/src/main/java/org/wso2/carbon/
> connector/ldap/SearchEntry.java#L95
> --
> Regards,
> *Piriya Sivalingam*
> *Software Engineer - Support Team*
> *WSO2*
> *Mobile : +94 77 8462039*
> [image: http://wso2.com/signature] <http://wso2.com/signature>

Nuwan Wimalasekara
Associate Technical Lead
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: +94 71 668 4620
Dev mailing list

Reply via email to