Add more specific exceptions

This commit is contained in:
2021-01-24 18:39:26 +03:00
parent 92e8ca0812
commit caa1bab9b5
13 changed files with 98 additions and 29 deletions

View File

@ -2,6 +2,7 @@
declare(strict_types=1);
use Nsq\Exception\NsqError;
use Nsq\Producer;
use PHPUnit\Framework\TestCase;
@ -12,7 +13,7 @@ final class ProducerTest extends TestCase
*/
public function testPubFail(string $topic, string $body, string $exceptionMessage): void
{
$this->expectException(Exception::class);
$this->expectException(NsqError::class);
$this->expectExceptionMessage($exceptionMessage);
$producer = new Producer('tcp://localhost:4150');