Hi UUF team,

Client OSGI service throw  UserPortalUIException with error message
(message) and error code (errorCode).

String error = "Failed to update user password.";
LOGGER.error(error, e);
throw new UserPortalUIException(error, e.getErrorCode());

Form client side .js I can retrieve error message as below

} catch (e) {
        var message = e.message;
        var cause = e.getCause();
        if (cause != null) {
            //the exceptions thrown by the actual osgi service method
is wrapped inside a InvocationTargetException.
            if (cause instanceof java.lang.reflect.InvocationTargetException) {
                message = cause.getTargetException().message;
            }
        }

Is there a way to retrieve errorCode as well ?

Thanks,
Gayan

-- 
Gayan Gunawardana
Software Engineer; WSO2 Inc.; http://wso2.com/
Email: [email protected]
Mobile: +94 (71) 8020933
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to