Closed Trigun27 closed 4 years ago
You’re welcome. Suggest looking at https://github.com/jasontaylordev/CleanArchitecture/blob/master/src/Application/Common/Interfaces/IIdentityService.cs. I’m using a result class in this case. Use a try-catch only if you can handle the error in the Infrastructure layer e.g. retry or cached, if not Result class.
Thank you for your project!
I have a REST service that I'm connecting to. The service is at Infrastructure level. But, where do I process errors of answers from REST?
As I understand it, I can't return HttpResponse to the App level because it's leaking. It's just important for the App to know if the request was successful or not.
As I see it. 1) try .. catch inside Application layer for a certain error.
2) or, make the Result class {T Data, string Error }.
In general, perhaps two approaches have their pros and cons. But which one is more in line with the philosophy