Skip to content

Implement a general response for all results #15

@ditros017

Description

@ditros017

Related to https://github.com/getopenwater/OpenWater/issues/5362

Hussein Mosaad 8:48 PM
yea, i mean for all functions
Dmitry Yakushin:penguin: 8:48 PM
but why, you could parse response status code
like 2xx => success - true
Hussein Mosaad 8:49 PM
nuget throws exceptions
Dmitry Yakushin:penguin: 8:49 PM
nuget == ApiClient?
Hussein Mosaad 8:49 PM
yea
like if there is a business exception
try to assign a judge to a round twice
it will throw 400
which is correct
Dmitry Yakushin:penguin: 8:50 PM
right
Hussein Mosaad 8:50 PM
but to handle that i should add try/catch
AssignJudgeToApplicationAsync
Dmitry Yakushin:penguin: 8:51 PM
so, we shouldn't throw errors for 400 responses
Hussein Mosaad 8:52 PM
yea, i think its better to have a generic response for all requests from nuget package as its a wrapper
but if i used REST APIs i get 400 responses which makes sense
what do you think ?
Dmitry Yakushin:penguin: 8:53 PM
so, you want a generic response like { result, success, errorMessage, code } as you said in issue?
Hussein Mosaad 8:53 PM
yea
Dmitry Yakushin:penguin: 8:54 PM
ok. I'll ask @vlad to do that on monday
probably it should be a task in api client
not awards
Hussein Mosaad 8:54 PM
yes
Dmitry Yakushin:penguin: 8:54 PM
ok
@kjohar should we prioritize@Hussein's feature request?
Vlad is working on Decanter.Extender
Hussein Mosaad 8:56 PM
its not high priority btw
Dmitry Yakushin:penguin: 8:56 PM
ok
Kunal Johar 8:57 PM
i added comment
Dmitry Yakushin:penguin: 8:57 PM
We'll implement this when Vlad finishes Decanter things.
Kunal Johar 8:58 PM
ok

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions