Hello Loredana,
Just went through your great article on medium.
I do not know if i'm in the right place to ask my question... Anyway :
I was experimenting your code, and i do not figure out how to handle the errors, for instance if the api is not answering.
I assume we throw the exeption throw Exception('Failed to load weather');.
But how do we catch the exception in order to display an error message in the UI for instance. I thought, I was able to get it via snapshot.hasError, but it does not seem to be that way...
Thank you !
Hello Loredana,
Just went through your great article on medium.
I do not know if i'm in the right place to ask my question... Anyway :
I was experimenting your code, and i do not figure out how to handle the errors, for instance if the api is not answering.
I assume we throw the exeption
throw Exception('Failed to load weather');.But how do we catch the exception in order to display an error message in the UI for instance. I thought, I was able to get it via
snapshot.hasError, but it does not seem to be that way...Thank you !