Catching an exception in app, that is thrown in service

Hi, currently working on a order system and we have a service for generating invoices for a given order. As we want to give the user a good experience we have implemented several “throw exception” situations in our service logic. But when these are triggered the only error message the user is left with (in the app) is that the entire service failed, not the custom messages that are thrown in the service.

We have an idea on how to bypass this by creating a sort of errormessage object, which is database connected and has a field for the error message. In this way we can extract the error message that is generated (added to the errormessage object in the service) and show it to our users in the app. We also looked at the event log mechanic, but dont feel like that is the optimal solution for this kind of problem.
If there is any simpler solutions, please let us know:)

1 Like

Hi!

We believe this is a bug on the platform side, and we’re on it. Throw exception vs catch custom error is not working as expected.

Will keep you posted!

2 Likes