22
Views
7
Comments
Solved
Unable to display database exceptional handler message
Application Type
Reactive

Hello , 

I have an application which raises an exception while entering duplicate records .

I have created database exception but while raising an exception it displays the All Exception error message .

Can you help me in displaying the database exception error message to the user .

I'm attaching the following OML file . It's in the Main module -> Add screen


Thanking You .

Regards ,

Rahul Gupta

UploadBulkExcel.oap

Rank: #69
Solution

Hi Rahul,

You did it correctly, according to the documentation the most specific exception has priority.

It appears to be a bug, please contact support.


To work around this problem, you can encapsulate CRUD actions in a Server action, and capture only database exceptions.

See the attachment.

UploadBulkExcelsugestion.oap

Rank: #1722

Hello Huarlem Lima ,

                                     Thanks for your efforts and time . It's working as I required .

Thanking You ,

Rahul Gupta .


Hi Rahul,

1] Drag "Excpetion Handler" widget and select "Database Exception" from the list


Although I made this example in Traditional Web App you can still use it in Reactive and Mobile.

I hope it will help you

Rank: #403

Hi Rahul,

I had switched the exceptions position and it worked how you want. But in this case, if you have any other exception it will throw "Record Already Exist" error message only. 

Alternate solution is to check whether the entered name/ID already exist into the entity or not before inserting new row and if combination of both exist simply through the message and do an exit from their.  

Please try and let me know, if this help you.

Thanks & Regards,

Sachin

Rank: #129

Hi Rahul,

I agree with Huarlem, exception handling is not working exactly as documentations says.

See also this earlier post  on the same subject

If I remember correctly, in Reactive you can handle a database exception in server action, but not in client action.

Hi Rahul,


I have also faced similar issue earlier. What I did is, I removed AllException handler and kept only specific handler on that action(in your case DB exception), and it worked properly. As we already have a global exception handler in-built, there won't be any issue if your specific handler could not catch exception at first place. You can apply this approach in few pages.


Thanks,

Sanjay

Rank: #328

Hi @Rahul Gupta 

Sanjay's  approach should work, it worked in my case

Thanks,

Swapnil