Skip to content

Commit 06f02dc

Browse files
authored
chore: return error when json marshal fails (#5436)
1 parent 2541b1c commit 06f02dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gateway/handle.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ func (gw *Handle) getJobDataFromRequest(req *webRequestT) (jobData *jobFromReq,
498498
}
499499
payload, err = json.Marshal(singularEventBatch)
500500
if err != nil {
501-
panic(err)
501+
err = errors.New(response.InvalidJSON)
502+
return
502503
}
503504
eventCount = len(userEvent.events)
504505
}

0 commit comments

Comments
 (0)