added exception messages to controllers

This commit is contained in:
Fran Jurmanović
2022-02-20 10:38:08 +01:00
parent 1b418ec5a2
commit 341647ccd9
18 changed files with 516 additions and 182 deletions

View File

@@ -44,7 +44,11 @@ func (wc *WalletsHeaderController) Get(c *gin.Context) {
auth := c.MustGet("auth")
body.Id = auth.(*models.Auth).Id
wm := wc.WalletService.GetHeader(c, body, walletId)
wm, exception := wc.WalletService.GetHeader(c, body, walletId)
if exception != nil {
c.JSON(exception.StatusCode, exception)
return
}
c.JSON(200, wm)
}