wp_die increasingly inadequate: e.g. SWF uploader cannot understand wp_die error messages
|Reported by:||simonwheatley||Owned by:|
I've been trying to diagnose some issues (http://wordpress.org/support/topic/162198) with the Flash uploader on my dev server. In my case the issue was within the function wp_handle_upload, specifically the file couldn't be moved to the correct location in the upload directory. wp_handle_upload tries to report any error using the function wp_die... but wp_die generates a human readable *HTML* error report, and the SWF uploader cannot understand human readable error reports, so the SWF uploader has to use it's near useless default message of "An error occurred in the upload. Please try again later." To compound matters, wp_die does not write anything to a log, nor does it allow errors to be emailed out so in this case and any similar cases, it's hard to debug without having to put excessive error_log instrumentation into the code.
The strides made recently by the WP team whereby WP runs without errors or notices (at least as far I've seen in WP 2.5 RC2) is fantastic, and opens up the possibilities for some really useful fail fast error handling, stack traces, optionally emailing errors to administrators, and so on. I believe _wp_die_ is now out of step with the modern Wordpress and needs replacing. I also know that talk is cheap, and I've not (yet) submitted a suggested patch for this.
Change History (5)
- Component changed from General to Upload
- Owner anonymous deleted