Skip to content

PHPC-1960: Do not use BulkWriteException for client-side errors #1708

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

Closed
wants to merge 4 commits into from

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Oct 1, 2024

Fix PHPC-1960

Comment on lines +35 to +36
OK: Got MongoDB\Driver\Exception\ConnectionTimeoutException
Failed to send "delete" command with database "%s": Failed to read 4 bytes: socket error or timeout
Copy link
Member Author

Choose a reason for hiding this comment

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

The current result is:

Deprecated: Creation of dynamic property MongoDB\Driver\Exception\RuntimeException::$writeResult is deprecated in /Users/jerome/Develop/mongo-php-driver/tests/manager/manager-executeBulkWrite_error-005.php on line 20
ALMOST: Got MongoDB\Driver\Exception\RuntimeException - expected MongoDB\Driver\Exception\ConnectionTimeoutException
Failed to send "delete" command with database "phongo": Failed to read 4 bytes: socket error or timeout

I need to fix the "dynamic property" issue and the exception class.

Copy link
Member Author

Choose a reason for hiding this comment

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

I got the correct exception class by using phongo_throw_exception_from_bson_error_t_and_reply(&error, &reply).

Deprecated: Creation of dynamic property MongoDB\Driver\Exception\ConnectionTimeoutException::$writeResult is deprecated in /Users/jerome/Develop/mongo-php-driver/tests/manager/manager-executeBulkWrite_error-005.php on line 20
OK: Got MongoDB\Driver\Exception\ConnectionTimeoutException
Failed to send "delete" command with database "phongo": Failed to read 4 bytes: socket error or timeout

Now I need to figure where the dynamic property comes from.

Copy link
Member Author

Choose a reason for hiding this comment

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

Test successful after adding ConnectionTimeoutException::$writeResult.

@jmikola jmikola changed the title PHPC-2344 Do not use BulkWriteException for client-side errors PHPC-1960: Do not use BulkWriteException for client-side errors Oct 1, 2024
@jmikola
Copy link
Member

jmikola commented Oct 8, 2024

Closed PHPC-1960 as "Won't Do", so closing this as well. See that issue for an explanation.

@jmikola jmikola closed this Oct 8, 2024
@GromNaN GromNaN deleted the PHPC-2344 branch December 30, 2024 11:08
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