Didn't find an answer for this question, but I might have not worded it properly. In that case, sorry.
I'm getting into Laravel's queued jobs to dispatch item deliveries in a game (basically boils down to sending a HTTP request and receiving a response). I ran into a wall though. How does Laravel determine whether a job has failed or succeeded? What exactly classifies it as failed?
A job is considered failed if it throws an unhandled exception for every attempt to run the job. This is done in Worker::process which forwards exceptions to handleJobException which in turn calls markJobAsFailedIfWillExceedMaxAttempts.
A job can use the InteractsWithQueue trait and call fail($exception = null) to signal that it has failed.