In my app, I have my action to check the network status and based on that I will display some message to the user. but by default, it is displaying "Request failed with an error"
The action is working good, but I need to disable the default message
Hi,
Look in Common > OnException (if you are not using the default check on project properties for global exception handler). Those error messages are created there. Make sure you really don't need them.
Best regards,
Marcelo
I'm just curious about why are you receiving the error message at all?If you don't have network and executes this client action, it will goes right in the IF (the False condition), will do an assign and will end the action.
What are you doing in the assign? Are you effectively going that way? There is anything else that you are doing after this client action that is causing an error?
Cheers,Eduardo Jauch
Hi, I'm having the same exact problem. I'm checking the network status at the beggining of the OnIitialize event client action, but it seems that it's executing something before that and the "Request failed with an error" message appear instead of mine. The question is where to check the network status if it's not correct to do it in the OnInitialize event
Mariela Mayorga wrote:
Hi Mariela,
Also note that you may see different behaviour in the browser than you would in the OutSystems Now app (or the actual application). It appears in my browser (Chrome) when I am offline, GetNetworkStatus still returns True but a CommunicationException is triggered. However, in OutSystems Now, GetNetworkStatus works as expected.
Either way, make sure you test your app in OutSystems Now to make sure you are seeing the correct behaviour.
Regards,
Richard
Hello Mariela,
I just made a test:
And when I open the screen, if the network is disconnected (no WiFi, no 4G/3G/H), I receive the message "Network Is Offiline".
Are you checking the network and still trying to do something that requires it?
Can you share a small module that we can use to reproduce the error?
Hi Eduardo.
This is the flow I have on my OnInitialize action:
Then, in the screen I have a register form, and this is the flow of the action called by the "save" button:
I'm checking the network status at the beginning of both, and if it's offline, the flow ends, so I don't think that it's executing anything else after that check.
Thanks for your soon answer.
Do you have any aggregate in this screen that is getting data from server? Maybe to provide the source of the form?
Something is trying to reach the server. Can be something in the screen, not necessarily in the logic
Cheers
Eduardo Jauch
Yes, I'm retreiving data from a static Entity in the form, but I understand that the OnInitialize event executes before the form is rendered. Does it retreive the data erlier? In that case, where do you recommend to do the validation to know if the device is connected or not?
Yes, the OnInitialize executes before. But you are just showing a message. The screen is still being executed.
The data will be retrieved asynchronously while the screen is rendered.
Here you have two options, at least.
1. Adopts an offline model, using local entities and synchronizing when required and network is available
2. Adopts redirecting to a screen to warn the user he is offline.
Hi Eduardo, you're right. It's my first mobile app, and I'm not used to the asynchronous way mobile applications work. Redirecting to a new screen works fine for my use case. Thank you very much.
Hi guys,
I'm having this same problem.
This action only work when the wi-fi is disabled or the mobile phone is on air plan mode.
Is there any other way to really check if even the wi-fi is enabled the mobile there is not internet connection?
Tiago Vital
Tiago Bojikian Costa Vital wrote:
Hello Tiago.
I think this post will resolve your problem.
https://www.outsystems.com/forums/discussion/30510/how-to-automatically-detect-internet-connection-status/
Regards
GAlmeida
Hi ,
I am trying to show user friendly message instead of communication exception messsage(Requested Failed with an Error) when i try to call server.
I have implemented logic for network status in my client login but still i am getting "Requested Failed with an Error".How can i solve this?
There is any update about this?I removed the error succesfully in the layout screen, but I wanna remove it also from the service center
Example:
I am receiving this error in my android device by default and also when i hit the login button.
How can i achieve logging in in android device and resolve this error.
Kindly help me with this issue.
Uma
Application type: Mobile
Navigate between screen, I'm getting error: "Request failed with an error", when device is on offline mode.
Kindly suggest how to handle this issue.
Ravi
Hello Ravi,
Please, create a new post on the forum, so it will receive more visibility
Cheers!
P.S. In any case, most likely is that on the destination screen (or if you are navigating from a screen action, you are trying to access the server (trough server actions or aggregates/data actions.
Possible solution is to actually implement a Offiline scenario, using local storage instead of accessing the server directly, and implement synchronization strategies, but all depends on what you are trying to do.
Again, create a new topic :)
Hi Ravi Kumar Tasubilli ,
Did you find the solution ?
Amreen
Hello Amreen
Every time you navigate to a screen that has Aggregates / Data Actions and the mobile is offline, you will generate an exception (Communication exception) when the aggregates / Data Actions are executed. Same thing if you are in the page and try to execute a server action while the mobile is offline. This exception will most likely be capture at the Global Exception Handler that will identify as a Communication exception and will show the message "Request Failed with an Error".That IS the expected behaviour. You are trying to reach the server, but can't.Like I said before in the post, if you want the screen to work offline, you have to implement your application using an offline approach. This is done using the local storage. You need to implement your local data model, implement synchronization logic, and on the screens, you retrieve and save data using the local storage, instead of fetching data from the database or calling server actions to save the data. Hope this helps.Cheers!
Hi Eduardo,
Thank you for your suggestions.
But I refered this troubleshooting doc for finding the root cause.
https://success.outsystems.com/support/troubleshooting/incident_models/incident_models_outsystems_11/quot_request_failed_with_an_error_quot_quot_the_connection_has_timed_out_quot_client_side_errors/?_gl=1*1x3webp*_gcl_au*NzIxOTQ1MjM2LjE3NDAzNzA1ODU.*_ga*MTE0MzUzODgyNi4xNzAxMTQ5NzU4*_ga_ZD4DTMHWR2*MTc0MDYzNzM2OS4xMjMuMS4xNzQwNjU5MDkxLjYwLjAuMA..*_ga_HGKNZZMWJS*MTc0MDY1NzA4NC4yNTcuMS4xNzQwNjU5MDkxLjYwLjEuNTAwODQ4NTMz*_ga_G11QMS1MBT*MTc0MDY1NzA4NC40ODIuMS4xNzQwNjU5MDkxLjAuMC4w
Amreen Shaikh
Sorry,
The link you provided is a way to troubleshooting reactive applications (not mobile ones) and for the situation when the errors seen are not been logged with enought information (client side triggered) and for older versions of the platform:This only applies to Reactive applications and Platform Server versions prior to 11.21.0 (the logging of client-side errors was already in Platform Server version 11.21.0 due to RPM-991). You probably should create a new topic if you are still having problems.Cheers,