E
E
Elnur Tazhimbetov2020-08-16 23:06:47
PHP
Elnur Tazhimbetov, 2020-08-16 23:06:47

How does Gearman know that an Exception has been thrown even if it is wrapped in a catch?

The worker exits with error code 1( exit(1)) on errors, even if it is wrapped with a try catch. How does Gearman know about an error and complete the task?
$worker->addFunction('someFunction', $this,'someFunction');
function someFunction(GearmanJob $job){
try{
throw new Exception('ERROR');
}catch(Exception $exception){
}
}

when starting this worker and executing functions german terminates the process.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-08-16
@tazhimbetov

so not everything can be wrapped, there are system level errors,
look for non-reversible, fix

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question