Update file controllers.go

This commit is contained in:
Mikhail 2024-06-08 17:24:30 +00:00
parent 7f87ba0b62
commit e59e3b5945

@ -108,7 +108,7 @@ func (receiver *AccountController) Get(ctx *fiber.Ctx) error {
account, err := receiver.accountRepo.FindByUserID(ctx.Context(), userID)
if err != nil {
if err.Type() == errors.ErrNotFound {
return ctx.Status(fiber.StatusNotFound).String("account not found")
return receiver.middleWare.Error(ctx, fiber.StatusNotFound, "no account", err)
}
return receiver.middleWare.ErrorOld(ctx, err)
}