[9.x] Fix Queue Failed_jobs insert issue with Exception contain UNICODE#41020
Conversation
|
As I said in #41016, I don't think there's a bug here. This PR will also be breaking for anyone using queues. |
|
In this case this error thorwing by a failed job (Swift_TransportException). Not a manual throwing. |
|
@boomhq can you link to the code that causes this? |
|
Can we use |
|
@driesvints imagine an error response from an external API (that is included in a Guzzle exception message) that is not in an encoding your database can store. That is the bug. |
For easy reproduce juste create a job with public function handle()
{
throw (new \Exception(utf8_decode ('ÐÑÙ0E\xE2\x�98\xA0World��7B¹!þÿ')));
}
Yes I would like your opinion on whether I should continue on this path. |
|
The Speaking of which: tests would be nice before merging :) |
|
I'm currently trying to write the tests. Sorry, I don't want to waste your time. I just hesitate because I want to do it right. |
89aad5c to
d9d9f05
Compare
|
Test added |
Can't Insert failed job exception with UNICODE character.
Add an "utf8_encode" front of exception.
If you have a better way, my ears is open
I deal manually with this case from laravel 5.5
Issues :
#24263
#41016