I was seeing a lot of xml construct PHP errors on the watchdog, and they were because of an attempt to parse XML from incorrect data.
Attached is a patch that not only check for codes <0 but also >= 500, and if detected, properly logging them into both status and watchdog and aborting the process instead of letting the parser continue.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1208810-2-proper-5xx-handling.patch | 2.06 KB | hanoii |
| #1 | 1208810-1-proper-5xx-handling.patch | 1.2 KB | hanoii |
Comments
Comment #1
hanoiiComment #2
hanoiiAttached is a better patch.
It also handled error code 0 as an error (I think it's due to timeout) and also handle the same <=0 and >= 500 errors on the batch processing to prevent cron from halting.
This again is specially useful for the lately 502 errors I (and others on google search) have been seeing.