I need queue job to re-run if it failed. I set $tries = 3
but I need to know if in job I catch exception is this will be considered as filed job and will be re-run?
Asked
Active
Viewed 202 times
0

mare96
- 3,749
- 1
- 16
- 28

Gor Azizyan
- 13
- 3
-
Which command are you using now? – Dilip Hirapara Jul 30 '19 at 13:52
1 Answers
1
The way a Laravel job knows if a jobs has failed is one of the following two:
- A job throws an exception which is NOT caught, resulting in the command failing with a big red text in the cli. (e.g.
throw new \RuntimeException('something went wrong');
- A job returns an error statuscode (e.g.
return -2;
)
I posted a more elaborate answer here

PtrTon
- 3,705
- 2
- 14
- 24