mirror of
https://github.com/danog/amp.git
synced 2025-01-22 05:11:42 +01:00
Better error message when emitting after resolve
This commit is contained in:
parent
cba57dd81e
commit
cf5ebb1408
@ -44,7 +44,7 @@ trait Producer {
|
||||
*/
|
||||
private function emit($value): Promise {
|
||||
if ($this->resolved) {
|
||||
throw new \Error("The stream has been resolved; cannot emit more values");
|
||||
throw new \Error("Streams cannot emit values after calling resolve");
|
||||
}
|
||||
|
||||
if ($value instanceof Promise) {
|
||||
|
@ -137,7 +137,7 @@ class ProducerTraitTest extends \PHPUnit_Framework_TestCase {
|
||||
/**
|
||||
* @depends testEmit
|
||||
* @expectedException \Error
|
||||
* @expectedExceptionMessage The stream has been resolved; cannot emit more values
|
||||
* @expectedExceptionMessage Streams cannot emit values after calling resolve
|
||||
*/
|
||||
public function testEmitAfterResolve() {
|
||||
$this->producer->resolve();
|
||||
|
Loading…
x
Reference in New Issue
Block a user