Throw exception instead of just exiting#1
Throw exception instead of just exiting#1mrn3 wants to merge 1 commit intoLeoPlatform:masterfrom mrn3:patch-1
Conversation
If failed to put message on the bus, we need to throw an exception instead of just exiting. This is leading to problems where the errors are swallowed and we aren't seeing why events aren't getting onto bus. Eventually, we need to add retries for this too.
| * @todo we need to kill this process osmehow | ||
| */ | ||
| exit(); | ||
| throw new \Exception("Could not put message on bus - result is: " . $result); |
There was a problem hiding this comment.
$result is an array, an the way this is written, it would throw an Array to string conversion error. So either $result would have to be flattened, or use the element of result that you want to see in Exception.
|
Yeah, I thought that might be a problem - I assumed it would just flatten it for me when printing. Do you know how to easily flatten it? I see some functions by searching, but not sure if there is any easy way. It would just be nice to get the whole payload so we can see what we need. Another option I guess is we could pass in just the array, right? function array_flatten($array,$return) { $res = array_flatten($myarray, array()); |
|
This change appears to have already been applied to the repo |
If failed to put message on the bus, we need to throw an exception instead of just exiting. This is leading to problems where the errors are swallowed and we aren't seeing why events aren't getting onto bus. Eventually, we need to add retries for this too.