Skip to content

Commit e5ae354

Browse files
authored
[13.x] Include job name and queue in InvalidPayloadException message (#60799)
* [13.x] Include job name and queue in InvalidPayloadException message * [13.x] the queue is not nullable
1 parent f377671 commit e5ae354

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Illuminate/Queue/Queue.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ protected function createPayload($job, $queue, $data = '', $delay = null)
136136

137137
if (json_last_error() !== JSON_ERROR_NONE) {
138138
throw new InvalidPayloadException(
139-
'Unable to JSON encode payload. Error ('.json_last_error().'): '.json_last_error_msg(), $value
139+
sprintf('Unable to JSON encode payload for job [%s] on queue [%s]. Error (%d): %s',
140+
$value['displayName'] ?? 'unknown', $queue, json_last_error(), json_last_error_msg()
141+
), $value
140142
);
141143
}
142144

0 commit comments

Comments
 (0)