Skip to content

PHPLIB-107: Do not throw when dropping nonexistent collection #32

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 3 commits into from
Sep 28, 2015

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Sep 28, 2015

$cursor = $server->executeCommand($this->databaseName, new Command(array('drop' => $this->collectionName)));
} catch (DriverRuntimeException $e) {
if ($e->getMessage() === 'ns not found') {
$result = (object) ['ok' => 0, 'errmsg' => 'ns not found'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Whats the $result used for here?
Is the throw below supposed to be in an else {} ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This should have been a return statement. Thanks for catching it: #33

@jmikola jmikola merged commit 3f12bc6 into mongodb:master Sep 28, 2015
jmikola added a commit that referenced this pull request Sep 28, 2015
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