Re: [Dev] [UUF] Exception Handling in UUF app

2017-03-20 Thread Manuranga Perera
Issue here is, actual code can be bit more complicated than that. eg: https://github.com/wso2/product-is/blob/master/portal/osgi-services/org.wso2.is.portal.user.client.api/src/main/java/org/wso2/is/portal/user/client/api/RecoveryMgtServiceImpl.java#L150:L163 On Mon, Mar 20, 2017 at 12:44 PM, Sa

Re: [Dev] [UUF] Exception Handling in UUF app

2017-03-20 Thread SajithAR Ariyarathna
IMO following approach would be better, try { // some logic goes here, that might throw an exception. // e.g. callOSGiService("org.wso2.is.portal.user.client.api.RecoveryMgtService","isNotificationBasedPasswordRe", []); return {success: true, message: {title: "Success", body: "Security question

Re: [Dev] [UUF] Exception Handling in UUF app

2017-03-20 Thread Manuranga Perera
UUF team, So what is the best practice we need to document ? Currently I see people just wrapping in Java and re-throwing some kind of UI error. I don't think wiring UI specific logic in Java is the best way to do this. And it's annoying to pass a "isSuccess" all over the code. Maybe we should ask

Re: [Dev] [UUF] Exception Handling in UUF app

2017-03-19 Thread SajithAR Ariyarathna
On Mon, Mar 20, 2017 at 9:42 AM, Pushpalanka Jayawardhana wrote: > Hi All, > > Shall we add a section on 'Error handling' to the UUF best practices > documentation to capture information on this? > > +1 > On Thu, Feb 2, 2017 at 8:43 AM, Dakshika Jayathilaka > wrote: > >> +1 for KasunGs suggesti

Re: [Dev] [UUF] Exception Handling in UUF app

2017-03-19 Thread Pushpalanka Jayawardhana
Hi All, Shall we add a section on 'Error handling' to the UUF best practices documentation to capture information on this? On Thu, Feb 2, 2017 at 8:43 AM, Dakshika Jayathilaka wrote: > +1 for KasunGs suggestion. > > Even UIExceptions can be different. > > *Types of UI errors* > >- User inpu

Re: [Dev] [UUF] Exception Handling in UUF app

2017-02-01 Thread Dakshika Jayathilaka
+1 for KasunGs suggestion. Even UIExceptions can be different. *Types of UI errors* - User input errors - App errors - Incompatible state errors IMHO depending on the permission level, above error messages can be optimized to give optimal user experience. Regards, *Dakshika Jayathila

Re: [Dev] [UUF] Exception Handling in UUF app

2017-01-31 Thread KasunG Gajasinghe
To not disclose the back-end server details to the user, we should always catch the exceptions in the UUF app. If it is a UIException, then we can show the error message to the user. Otherwise, we should show a generic error message - something like "An error has occurred while processing your requ

[Dev] [UUF] Exception Handling in UUF app

2017-01-31 Thread Ayesha Dissanayaka
Hi, What are the good practices around exception handling in UUF in scenarios like handling exceptions thrown when callOSGiService. for example consider below method. > /** > * Check whether the notification based password recovery enabled > */ > > function isNotificationBasedP