shua
shua
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
or is it private
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
whats link to ur repo?
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
refactors never stop!
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
that will make you a great programmer
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
nothing wrong with that
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
oh yeah FluentValidation
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
:Shrug: im just spitballing
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
but "generic": "Some message"
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
so for example you will always have a dictionary
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
You could categorize them as Generic
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
you know where the string is the message, and IType is some custom type (if u even need to go that deep)
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
or a Dictionary<IType, string>
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
haha yeah I mean, I would say the easiest thing is a dictionary<string,string>
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Prob a dictionary yeah the way to go, have you ever used params keyword? It might be useful
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Can you give me an example where 2 would be entirely different responses?
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
I think it's kind of up to you unless you pull in a custom nuget that does that sort of thing. You could do something like a IApiResponse CustomResponse: IApiResponse and have multiple classes , or something like that or differently formatted ones.. not really sure tbh, ctor overloads seem to be the way to go
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
If you're using Web API I think they have a HttpRequestMessage class, and in Azure Functions its HttpResponseMessage (I think)
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Looks good to me, you could have overloaded constructors when you need to pass in diff stuff or massage the info differently
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
I would imagine just making a class to represent the ApiResponse
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
How are you doing it now?
160 replies