Hi all!
I would like to know which is the best way to handle a general, app-level error system; I find myself to reuse this code for each error response:
var responseDto = new ErrorResponse
{
ResponseStatus = new ResponseStatus
{
ErrorCode = "my error code",
Message = "my response message"
}
};
return new HttpError(HttpStatusCode.NotFound, "Not Found")
{
Response = responseDto
};
Should I put it in a class and recall it from each service? Should I write an Interface system like the LogManager does?
Thank you!