Errors when checking role on call to server action in a mobile application

In the error logs of our mobile app we get a lot of xxx role required messages.
This seems to be caused by the fact that users put their devices in a charger at night without doing a explicit logout (after which the are redirected to the logon screen)
In the morning when they resume working their sessions are expired.
When they press a button or anything in the still open app and a server action is triggered the permissions are checked by the platform and an error is thrown.

Is it possible to prevent this error to appear in the logs? I don't seem to be able to catch it in the server action or in the client action making the request.

I have created a simple app to test. It has a screen with a button. When pressed the following client action is performed:

The DoSomeThingOnTheServer server action looks like

When the button is pressed the AllExceptions Handler in the catches the error, but at that time there is already an entry in the error log. The DoSomeThingOnTheServer does not catch anything.

Is there a way to avoid the creation of these error log entries? I would my error log to only show errors i should act upon.


With kind regards,


Daan

Hi Daan,

Do you are using the OfflineDataSync? In the Sync actions there is a RegisterUser role check, maybe was this action that was generating the logs.


Leandro Correa wrote:

Hi Daan,

Do you are using the OfflineDataSync? In the Sync actions there is a RegisterUser role check, maybe was this action that was generating the logs.


Hi Leandro,

I'm not using the OfflineDataSync. It happens when a user is logged out but stays in a screen and then calls any server action.

I've attached a sample application.

When you press "server action" you will get a message from the server.
If you press server action after you have pressed logout the error message will be displayed as it is handled in the action, but there is still an entry in the error log. (same for the combined logout and server action button)

I just tried it with a reactive web app and then i have the same issue.

Regards,


Daan