Skip to content

Commit 7107e57

Browse files
timacdonaldtaylorotwell
authored andcommitted
[5.4] Improve Queue's InvalidPayloadException error message (#20143)
* add exception message * Update Queue.php
1 parent 6e72548 commit 7107e57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Queue/Queue.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ protected function createPayload($job, $data = '', $queue = null)
8686
$payload = json_encode($this->createPayloadArray($job, $data, $queue));
8787

8888
if (JSON_ERROR_NONE !== json_last_error()) {
89-
throw new InvalidPayloadException;
89+
throw new InvalidPayloadException(
90+
'Unable to JSON encode payload. Error code: '.json_last_error()
91+
);
9092
}
9193

9294
return $payload;

0 commit comments

Comments
 (0)