Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#8 | maint.png | 13.85 KB | chx |
#5 | 1306074.exception-handling-5.patch | 2.29 KB | phayes |
#3 | mongodb_wsod_1306074-2.patch | 3.22 KB | phayes |
#1 | mongodb_wsod_1306074-1.patch | 30.62 KB | zeisllo |
Comments
Comment #1
zeisllo CreditAttribution: zeisllo commentedComment #2
phayes CreditAttribution: phayes commentedIt looks like the patch does not apply to the latest 6.x version in git. I'll be re-rolling it.
Comment #3
phayes CreditAttribution: phayes commentedAttached 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.
Comment #4
chx CreditAttribution: chx commentedThanks 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/
Comment #5
phayes CreditAttribution: phayes commentedHere'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 FALSEComment #6
chx CreditAttribution: chx commentedTaking this over.
Comment #7
chx CreditAttribution: chx commentedSo, 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.
Comment #8
chx CreditAttribution: chx commented