Current section: Provider Errors 4 exercises

Handling Errors in Third-Party API Calls

Loading exercise


00:00 Sometimes errors happen even in our third-party APIs, and we should probably handle those reasonably well. And so if we go to our GitHub mock right here and uncomment this inside of the access token API call, for example, then right now, with what we have implemented, nothing happens.

00:19 I click on this, nothing happens. I click on it a million times, nothing happens. Well, something actually is happening. If we check our logs, we're seeing this big fail-to-fetch throw and all bad stuff going on there. So we actually need to handle this properly, and that is your task for this exercise. I want you to handle this, and I want you to send them back to the login screen

00:39 with a Toast message that explains the problem, or that there was a problem. And yeah, that's the first part of this exercise. Have fun with this.