Skip to content

Commit

Permalink
Don’t catch exceptions anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
lstrojny committed Jul 5, 2023
1 parent 7f33b47 commit 3fd82e1
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace OpenTelemetry\Tests\Instrumentation\MongoDB\tests\Integration;

use ArrayObject;
use MongoDB\Driver\Exception\ConnectionException;
use MongoDB\Driver\Exception\ServerException;
use MongoDB\Driver\Manager;
use MongoDB\Operation\FindOne;
use OpenTelemetry\API\Instrumentation\Configurator;
Expand Down Expand Up @@ -51,14 +49,11 @@ public function tearDown(): void

public function test_mongodb_find_one(): void
{
$manager = new Manager();
$manager = new Manager('mongodb://127.0.0.1:27017');

$find = new FindOne(self::DATABASE_NAME, self::COLLECTION_NAME, ['a' => 'b']);

try {
$find->execute($manager->selectServer());
} catch (ServerException|ConnectionException $e) {
}
$find->execute($manager->selectServer());

$this->assertCount(1, $this->storage);
$this->span = $this->storage->offsetGet(0);
Expand Down

0 comments on commit 3fd82e1

Please sign in to comment.