peladodocinero
The best way to handle Errors in Clean Arch
Can we make a call so can you help me? I'm new and I can't figure out how to do it. Because I have many services, and for example, in the users service, I want to return a JSON object of this style:
{
statusCode: ...,
message: ...,
[MODEL]
}
The [MODEL] depends on the service. In the example I am giving you, the Model would be the UserDTO
44 replies
The best way to handle Errors in Clean Arch
That's exactly what I mean. My service is in the Application layer, I don't want it to return a BadRequest, since that is from API and Http. I am a Typescript backend programmer in Nodejs, and before, I did what you mentioned, that is, returning an object with a message and its StatusCode. Is it functional? Does it belong to Clean Arch? Is there any other alternative?
44 replies