Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Fixed PHP-1425: explain() does not raise appropriate exception for conditions #843

Merged
merged 3 commits into from
Apr 7, 2015

Conversation

derickr
Copy link
Contributor

@derickr derickr commented Apr 1, 2015

No description provided.

}

$m->admin->command( array( 'setParameter' => 1, 'notablescan' => 0 ) );
?>
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't have to be both in the catch() and outside it.
Also, on failure this test won't print anything - thats abit confusing. how about ending with echo ok or ===DONE=== ? :]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know it doesn't need to be in both, but it's just to be on the safe side :-)

@bjori
Copy link
Contributor

bjori commented Apr 1, 2015

Looks like travis doesn't agree with you on the error code.

Was explain() the only helper that relied on MongoCursor::next() doing the error handling? No other helpers missing php_mongo_handle_error() ?

@jmikola
Copy link
Member

jmikola commented Apr 2, 2015

Was explain() the only helper that relied on MongoCursor::next() doing the error handling? No other helpers missing php_mongo_handle_error() ?

From a quick grep, it looks like the legacy collection/index enumeration, php_mongo_runcommand, and php_mongo_collection_findone all called php_mongo_handle_error, as did the relevant cursor functions. Of note, findAndModify uses php_mongo_runcommand, so we're covered there. I can't imagine the other command helpers do anything differently.

@bjori
Copy link
Contributor

bjori commented Apr 2, 2015

lgtm then.
the new testcase also reads better \o/

@derickr derickr merged commit 56ad50c into mongodb:v1.6 Apr 7, 2015
derickr added a commit that referenced this pull request Apr 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants