Closed
Description
Is your feature request related to a problem? Please describe
Refactor all findStripeSubscriptionIdForTeam to return a 404 error instead of undefined
when something cannot be found to be differentiate precisely between various cases.
Describe the behaviour you'd like
E.g.
async findSomething(query): Promise<Something | undefined> {
if (!something) {
return undefined;
}
return something;
}
would become
async findSomething(query): Promise<Something> {
if (!something) {
throw new ResponseError(ErrorCodes.NOT_FOUND, "Could not find something");
}
return something;
}
This would of course also need to be handled by all clients, for example the dashboard (where a undefined
check should become a 404 error catcher).
Describe alternatives you've considered
- Staying with
undefined
(status quo)