Skip to content

Commit 78e6b2f

Browse files
authored
Merge pull request #145 from mahmednabil109/log_storage_err
Log storage errors
2 parents 306c92b + c50ef0f commit 78e6b2f

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)