Skip to content

Base exception interface does not extend Throwable #940

Closed
@alcaeus

Description

@alcaeus

Description

The base exception interface used in the driver (MongoDB\Driver\Exception\Exception) does not extend the Throwable or Exception base interfaces. This can be problematic; in our case, Doctrine MongoDB ODM documented a @throws \MongoDB\Driver\Exception\Exception on a class, which is then caught by static analysis with PHPStan:

PHPDoc tag @throws with type MongoDB\Driver\Exception\Exception is not subtype of Throwable

Environment

ext-mongodb version: 1.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions