Skip to content

Commit c50ef0f

Browse files
Log storage errors
Signed-off-by: Mohamed Abokammer <mahmednabil109@gmail.com>
1 parent 5b8e421 commit c50ef0f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmds/admin_server/server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func (r *RouteHandler) addLogs(c *gin.Context) {
126126
ctx = ctx.WithLogger(r.log)
127127
err := r.storage.StoreLogs(ctx, storageLogs)
128128
if err != nil {
129+
r.log.Errorf("Err while storing logs: %v", err)
129130
switch {
130131
case errors.Is(err, storage.ErrInsert):
131132
c.JSON(http.StatusInternalServerError, gin.H{"status": "err", "msg": "error while storing the batch"})
@@ -155,6 +156,7 @@ func (r *RouteHandler) getLogs(c *gin.Context) {
155156
result, err := r.storage.GetLogs(ctx, query.ToStorageQuery())
156157
if err != nil {
157158
c.JSON(http.StatusInternalServerError, gin.H{"status": "err", "msg": "error while getting the logs"})
159+
r.log.Errorf("Err while getting logs from storage: %v", err)
158160
return
159161
}
160162

0 commit comments

Comments
 (0)