Possibly need try catch around methods.

For example...

PHP Fatal error: Uncaught exception 'MongoCursorException' with message 'couldn't connect to any servers in the list' in mongodb/mongodb_watchdog/mongodb_watchdog.module:110

PHP Fatal error: Uncaught exception 'MongoCursorException' with message 'couldn't send query: Broken pipe' in mongodb/mongodb_watchdog/mongodb_watchdog.module:111

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zeisllo’s picture

FileSize
30.62 KB
phayes’s picture

Assigned: Unassigned » phayes
Status: Active » Needs work

It looks like the patch does not apply to the latest 6.x version in git. I'll be re-rolling it.

phayes’s picture

Status: Needs work » Needs review
FileSize
3.22 KB

Attached is a patch that should apply cleanly to the latest dev. It is also a much smaller and less ambitious patch. Let's get this in place first then go from there.

chx’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work

Thanks for working on this! However, fixes go upstream and get backported from there. Also, please adhere to Drupal coding standards. http://drupal.org/coding-standards/

phayes’s picture

Here's the first-cut of a patch again 7.x-1.x. It's a marginal improvement, but there is a lot more work to be done.

grep -RFn "mongodb_collection(" * | wc -l shows 69 places where we need to implement exception handling for when mongodb_collection returns FALSE

chx’s picture

Assigned: phayes » chx

Taking this over.

chx’s picture

Component: Watchdog » Miscellaneous
Status: Needs work » Fixed

So, returning as if nothing happened and just watchdogging is not a good idea. Throwing an exception is the right thing to do we just need to make sure that Drupal can handle it and there is not another exception thrown while at it. I have added code to make this happen.

phayes, your work was not in vain: it made me realize what to do -- if 69 places need patching that's wrong.

chx’s picture

FileSize
13.85 KB

maint.png

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.