mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
fix: add err handling to db queries (#2064)
* fix: add err handling to db queries * chore: add error handling to GetApp * chore: wrap the original error * fix: retrieve balance after err != nil check * chore: minor code cleanup * chore: add error handling to app permission listing in GetApp * chore: convert GetBudgetUsageSat to GetBudgetUsage * chore: add tests for GetBudgetUsage * chore: separate budget window tests --------- Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
This commit is contained in:
parent
4a924c3d11
commit
3aa167a7c4
13 changed files with 387 additions and 45 deletions
|
|
@ -1051,7 +1051,12 @@ func (httpSvc *HttpService) appsShowByPubkeyHandler(c echo.Context) error {
|
|||
})
|
||||
}
|
||||
|
||||
response := httpSvc.api.GetApp(dbApp)
|
||||
response, err := httpSvc.api.GetApp(dbApp)
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusInternalServerError, ErrorResponse{
|
||||
Message: err.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
|
@ -1079,7 +1084,12 @@ func (httpSvc *HttpService) appsShowHandler(c echo.Context) error {
|
|||
})
|
||||
}
|
||||
|
||||
response := httpSvc.api.GetApp(dbApp)
|
||||
response, err := httpSvc.api.GetApp(dbApp)
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusInternalServerError, ErrorResponse{
|
||||
Message: err.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue