Hi Gayan,
We have already defined an exception hierarchy for identity components.
IdentityException[1]
├── IdentityServerException[2]
└── IdentityClientException[3]
All exceptions classes defined for identity components extend either
IdentityServerException
or IdentityClientException.
So any client can catch the exception as follows,
catch (IdentityClientException ex) {
// Can return the same error message and code to the client
} catch (IdentityException ex) {
// Need to log and return a generic message to the client
}
Since we add these exception classes recently, we need to
update carbon-identity-mgt repo.
[1] -
https://github.com/wso2/carbon-identity-commons/blob/master/components/org.wso2.carbon.identity.common/src/main/java/org/wso2/carbon/identity/common/base/exception/IdentityException.java
[2] -
https://github.com/wso2/carbon-identity-commons/blob/master/components/org.wso2.carbon.identity.common/src/main/java/org/wso2/carbon/identity/common/base/exception/IdentityServerException.java
[3] -
https://github.com/wso2/carbon-identity-commons/blob/master/components/org.wso2.carbon.identity.common/src/main/java/org/wso2/carbon/identity/common/base/exception/IdentityClientException.java
Thanks,
Thanuja
On Mon, Feb 27, 2017 at 10:06 AM, Ruwan Abeykoon <[email protected]> wrote:
> Hi All,
> +1 to have an exception hierarchy, which carries information for specific
> errors.
>
> I think we should follow the way Java IO exceptions are done.
>
> Cheers,
> Ruwan
>
>
> On Mon, Feb 27, 2017 at 9:58 AM, Gayan Gunawardana <[email protected]> wrote:
>
>> Hi All,
>>
>> Shall we revisit IdentityStore APIs? For an example addUser method[1]
>> throws IdentityStoreClientException and IdentityStoreServerException in
>> many cases where client cannot differentiate the reason. There will be
>> relevant error message but client cannot rely on error message to take
>> decisions.
>> IMO we should have proper exception hierarchy or error codes. I'm +1 to
>> have
>> exception hierarchy.
>>
>> WDYT ?
>>
>> [1] https://github.com/wso2/carbon-identity-mgt/blob/master/
>> components/org.wso2.carbon.identity.mgt/src/main/java/
>> org/wso2/carbon/identity/mgt/impl/IdentityStoreImpl.java#L985
>>
>> Thanks,
>> Gayan
>> --
>> Gayan Gunawardana
>> Software Engineer; WSO2 Inc.; http://wso2.com/
>> Email: [email protected]
>> Mobile: +94 (71) 8020933
>>
>
>
>
> --
>
> *Ruwan Abeykoon*
> *Associate Director/Architect**,*
> *WSO2, Inc. http://wso2.com <https://wso2.com/signature> *
> *lean.enterprise.middleware.*
>
>
--
*Thanuja Lakmal*
Senior Software Engineer
WSO2 Inc. http://wso2.com/
*lean.enterprise.middleware*
Mobile: +94715979891 +94758009992
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture