backend: membership errorhandling tests
This commit is contained in:
@@ -132,7 +132,7 @@ func (mc *MembershipController) DeleteSubscription(c *gin.Context) {
|
||||
if err := mc.Service.DeleteSubscription(&data.Subscription.ID, &data.Subscription.Name); err != nil {
|
||||
if err == errors.ErrNoData {
|
||||
utils.RespondWithError(c, err, "Missing subscription name during deletion", http.StatusExpectationFailed, errors.Responses.Fields.SubscriptionModel, errors.Responses.Keys.Invalid)
|
||||
} else if err == errors.ErrNotFound {
|
||||
} else if err == errors.ErrSubscriptionNotFound {
|
||||
utils.RespondWithError(c, err, "Subscription not found", http.StatusNotFound, errors.Responses.Fields.SubscriptionModel, errors.Responses.Keys.NotFound)
|
||||
} else if err == errors.ErrInvalidSubscriptionData {
|
||||
utils.RespondWithError(c, err, "Invalid subscription data", http.StatusBadRequest, errors.Responses.Fields.SubscriptionModel, errors.Responses.Keys.Invalid)
|
||||
|
||||
Reference in New Issue
Block a user