[Mobile] How to use HasFetchError from other sources

Hi guys!

I'm trying here to use the HasFetchError from other sources but I can't figure out how to use it properly.

I'm trying to catch timeouts from exception handlers but once there, I can't go to the onAfterFetch event.

Any explanation when/how to use this?

Thanks!

Mikael Serra wrote:

Hi guys!

I'm trying here to use the HasFetchError from other sources but I can't figure out how to use it properly.

I'm trying to catch timeouts from exception handlers but once there, I can't go to the onAfterFetch event.

Any explanation when/how to use this?

Thanks!

Hi Mikael,


Have you tried just throwing an exception in the flow of the data action. It should trigger the HasFetchError boolean

Hi Luis,

When you fetch data with any these:

You have available a built-in property HasFetchError, same way you access the empty property of a list.

What I want is to understand when this HasFetchError is coming as true. I'm not able to replicate it.

Cheers.

Mikael Serra wrote:

Hi Luis,

When you fetch data with any these:

You have available a built-in property HasFetchError, same way you access the empty property of a list.

What I want is to understand when this HasFetchError is coming as true. I'm not able to replicate it.

Cheers.

Where do you want to use that property?
If you use in the screen I think is returned automatically when the Fetch Data return error:


Luís Cardoso wrote:

Mikael Serra wrote:

Hi Luis,

When you fetch data with any these:

You have available a built-in property HasFetchError, same way you access the empty property of a list.

What I want is to understand when this HasFetchError is coming as true. I'm not able to replicate it.

Cheers.

Where do you want to use that property?
If you use in the screen I think is returned automatically when the Fetch Data return error:


Yes, so I want to be able to receive it as True. I've tried to catch timeouts or return an error from the server but I always end up in the Exception handler. I want to understand How can I have the request to continue to the OnAfterFetch action and see this property has True.


Mikael Serra wrote:

Luís Cardoso wrote:

Mikael Serra wrote:

Hi Luis,

When you fetch data with any these:

You have available a built-in property HasFetchError, same way you access the empty property of a list.

What I want is to understand when this HasFetchError is coming as true. I'm not able to replicate it.

Cheers.

Where do you want to use that property?
If you use in the screen I think is returned automatically when the Fetch Data return error:


Yes, so I want to be able to receive it as True. I've tried to catch timeouts or return an error from the server but I always end up in the Exception handler. I want to understand How can I have the request to continue to the OnAfterFetch action and see this property has True.


Hi! I found this post in an example: https://www.outsystems.com/forums/discussion/37628/handle-exception-for-offline-aggregate/#Post136609
I think that "HasFetchError" should be used on screen and will be show to the user when the application go to On Exception flow.

Can you test this?

Br,

Luis


Luís Cardoso wrote:

Mikael Serra wrote:

Luís Cardoso wrote:

Mikael Serra wrote:

Hi Luis,

When you fetch data with any these:

You have available a built-in property HasFetchError, same way you access the empty property of a list.

What I want is to understand when this HasFetchError is coming as true. I'm not able to replicate it.

Cheers.

Where do you want to use that property?
If you use in the screen I think is returned automatically when the Fetch Data return error:


Yes, so I want to be able to receive it as True. I've tried to catch timeouts or return an error from the server but I always end up in the Exception handler. I want to understand How can I have the request to continue to the OnAfterFetch action and see this property has True.


Hi! I found this post in an example: https://www.outsystems.com/forums/discussion/37628/handle-exception-for-offline-aggregate/#Post136609
I think that "HasFetchError" should be used on screen and will be show to the user when the application go to On Exception flow.

Can you test this?

Br,

Luis


Yeah I've tried that, I'm going to the handler and it stops there. It does not continue to the on after fetching, or at least I can't make it work like that.


Solution

I attach an example mobile app with a screen with an IF that show only when return HasFetchError = True

Can you have a look and test it?


 

Solution

Luís Cardoso wrote:

I attach an example mobile app with a screen with an IF that show only when return HasFetchError = True

Can you have a look and test it?


 


Thanks Luís!

I should have done the test you did but I was to focused on the OnAfterFetch event. 

To resume, I was expecting (I wanted to) the action to still trigger the OnAfterFetch and then take an action from the result of the HasFetchError.

But it does not seem to work like that.

Thanks for the help guys.