Yeah, I’d say the same. Handle API errors within the Repository and expose a “result type” from the Repository, rather than throwing an exception from the Repository.
❤️ 3
o
Omar Qadour
04/07/2022, 6:41 PM
Okay, so i have to make an extra class, let's say "SafeApiRequest", then a function in it to make the request and to throw an exception, if needed. Then i extend this class in my repository and make the api call through it. Is that right?