1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00

Convert RuntimeException to CombinatorException

This commit is contained in:
Niklas Keller 2015-09-23 22:56:55 +02:00
parent 63055f0784
commit 00898cd6af
3 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# dev
- n/a
- Convert general `\RuntimeException` to more specific
`Amp\CombinatorException`.
### 1.0.4

View File

@ -0,0 +1,7 @@
<?php
namespace Amp;
class CombinatorException extends \RuntimeException {
}

View File

@ -310,7 +310,7 @@ function some(array $promises) {
}
if (empty($struct->results)) {
array_unshift($struct->errors, "All promises passed to Amp\some() failed");
$struct->promisor->fail(new \RuntimeException(
$struct->promisor->fail(new CombinatorException(
implode("\n\n", $struct->errors)
));
} else {
@ -407,7 +407,7 @@ function first(array $promises) {
return;
}
if (--$struct->remaining === 0) {
$struct->promisor->fail(new \RuntimeException(
$struct->promisor->fail(new CombinatorException(
"All promises failed"
));
}