-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log all reasons from a Amp\MultiReasonException
Instead of logging the message "Fatal error: Uncaught Amp\MultiReasonException: Multiple errors encountered; use Amp\MultiReasonException::getReasons() to retrieve the array of exceptions thrown in ~" log all individual exceptions so you can see what's actually going wrong
- Loading branch information
1 parent
c3b6e4c
commit 82ceb70
Showing
3 changed files
with
99 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Webgriffe\Esb; | ||
|
||
use Amp\Promise; | ||
use Amp\Success; | ||
use Webgriffe\Esb\Model\JobInterface; | ||
use function Amp\call; | ||
|
||
final class MultiReasonInitFailingWorker implements WorkerInterface | ||
{ | ||
/** | ||
* @return Promise | ||
*/ | ||
public function init(): Promise | ||
{ | ||
return Promise\some([ | ||
call(function () { throw new \Exception('Exception number one'); } ), | ||
call(function () { throw new \Exception('Exception number two'); } ), | ||
], 2); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function work(JobInterface $job): Promise | ||
{ | ||
return new Success(); | ||
} | ||
} |