Skip to content

PHPC-2349, PHPC-2411: Deprecate unused exception classes #1608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jul 10, 2024

@alcaeus alcaeus requested a review from GromNaN July 10, 2024 13:30
@alcaeus alcaeus self-assigned this Jul 10, 2024
@alcaeus alcaeus force-pushed the phpc-2349-deprecate-writeexception branch 2 times, most recently from cd73f37 to ae247f2 Compare July 11, 2024 09:10
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BulkWriteException is extending WriteException, does it trigger a warning when a BulkWriteException is thrown?
Can you make BulkWriteException extend RuntimeException instead?

@alcaeus
Copy link
Member Author

alcaeus commented Jul 11, 2024

Can you make BulkWriteException extend RuntimeException instead?

That's not possible, as anybody currently catching a WriteException would no longer be catching a BulkWriteException.

As for the deprecation notices, there currently aren't any deprecation notices thrown in tests, despite us using BulkWriteException in a number of places. I can do some more testing with this though, especially since there's another exception class to be deprecated (SSLConnectionException) that I can put into this PR as well.

@alcaeus
Copy link
Member Author

alcaeus commented Jul 12, 2024

I can do some more testing with this though

After checking, PHP doesn't seem to emit any deprecation warnings for deprecated classes. People will have to rely on their IDE or on third-party tools to let them know about the deprecation.

@alcaeus alcaeus changed the title PHPC-2349: Deprecate WriteException class PHPC-2349, PHPC-2411: Deprecate unused exception classes Jul 12, 2024
@alcaeus alcaeus requested a review from GromNaN July 12, 2024 11:50
@alcaeus alcaeus force-pushed the phpc-2349-deprecate-writeexception branch from 7b86f54 to d0e39ef Compare July 12, 2024 11:51
@alcaeus alcaeus force-pushed the phpc-2349-deprecate-writeexception branch from d0e39ef to 08bc3ee Compare July 15, 2024 13:06
@alcaeus alcaeus merged commit 4d6781a into mongodb:master Jul 15, 2024
68 of 72 checks passed
@alcaeus alcaeus deleted the phpc-2349-deprecate-writeexception branch July 15, 2024 14:06
alcaeus added a commit that referenced this pull request Sep 4, 2024
* master: (22 commits)
  PHPC-2434: Add PHP 8.4 to GitHub Actions (#1625)
  PHPC-2421, PHPC-2428: Update bundled dependencies (#1622)
  Don't build libmongoc version in pull requests
  Use drivers-evergreen-tools for Windows testing (#1615)
  PHPC-1957 Add tests for out-of-range UTCDateTime values (#1614)
  PHPC-2286 Implement `UTCDateTime::toDateTimeImmutable` (#1611)
  PHPC-2414, PHPC-2415: Update wire versions for MongoDB 8.0 compatibility (#1610)
  PHPC-2349, PHPC-2411: Deprecate unused exception classes (#1608)
  Fix failing tests on x86 systems (#1609)
  PHPC-2347: Deprecate BSON functions (#1607)
  PHPC-1489: Deprecate integer readPreference constants (#1604)
  Fix version computation for libmongoc development versions (#1599)
  PHPC-2376: Test against MongoDB 8.0 (#1598)
  PHPC-2254: Relax server selection timeout error message pattern (#1587)
  PHPC-2401: Support QEv2 range protocol (#1583)
  PHPC-2398: Use server_id methods for libmongoc 1.28+ (#1582)
  PHPC-2395: Fetch Atlas connectivity URIs from AWS Secrets Manager (#1579)
  Merge v1.19 into master (#1578)
  Revert "Bump mongodb-labs/drivers-github-tools from 1 to 2 (#1568)" (#1571)
  Bump mongodb-labs/drivers-github-tools from 1 to 2 (#1568)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants