In case the worker is run as a CLI command and an exception is thrown, the $error property storing the message can never be reset leading to false reports in case in case you use, say LoggerInterface::error() to report it.
Add a method to reset the $error property, like a setter or make the property's visibility to protected.
At the moment, the only way to "reset" it, is to use reflection and set the property to accessible.
In case the worker is run as a CLI command and an exception is thrown, the
$errorproperty storing the message can never be reset leading to false reports in case in case you use, sayLoggerInterface::error()to report it.Add a method to reset the
$errorproperty, like a setter or make the property's visibility to protected.At the moment, the only way to "reset" it, is to use reflection and set the property to accessible.