Skip to content

Commit

Permalink
chore: return error when json marshal fails (#5436)
Browse files Browse the repository at this point in the history
  • Loading branch information
cisse21 authored Jan 20, 2025
1 parent 2541b1c commit 06f02dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gateway/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ func (gw *Handle) getJobDataFromRequest(req *webRequestT) (jobData *jobFromReq,
}
payload, err = json.Marshal(singularEventBatch)
if err != nil {
panic(err)
err = errors.New(response.InvalidJSON)
return
}
eventCount = len(userEvent.events)
}
Expand Down

0 comments on commit 06f02dc

Please sign in to comment.