Letractively / forceworkbench

Automatically exported from code.google.com/p/forceworkbench
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Fix Error Handling to Not Blow Up on Warnings #475

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
forceworkbench 
F`10.1.225.32`GET`Workbench/trunk`/beta/downloadAsyncBatch.php`na4-api.salesforc
e.com`00D600000006n8LEAQ`00560000000wX0aAAE`

BulkApiClient-364-4e1b1fc4b84ea

Array (
[isPost] =>  [url] => 
https://na4-api.salesforce.com/services/async/22.0/job/75060000000QceuAAC/batch/
75160000000RGA1AAO/request 
[contentType] =>  
[data] =>  
[toFile] => Resource id #45 
[ch] => Resource id #46 
[httpHeaders] => Array ( 
[0] => X-SFDC-Session: ***
[1] => Accept: application/xml 
[2] => User-Agent: Workbench/trunk 
[3] => Expect: )  ) 

Original issue reported on code.google.com by ryan.bra...@gmail.com on 11 Jul 2011 at 4:09

GoogleCodeExporter commented 9 years ago
curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: cannot 
represent a stream of type Output as a STDIO FILE

Original comment by ryan.bra...@gmail.com on 11 Jul 2011 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by ryan.bra...@gmail.com on 20 Jul 2011 at 9:30

GoogleCodeExporter commented 9 years ago
Something like this:

function handleAllErrors($errno, $errstr, $errfile, $errline, $errcontext) {
    $errorId = basename($errfile, ".php") . "-$errline-" . time();
    workbenchLog(LOG_CRIT, "F", $errorId . ":" . print_r(debug_backtrace(), true));

                switch ($errno) {
                                case E_PARSE:
                    case E_ERROR:
                                case E_USER_ERROR:
                                case E_RECOVERABLE_ERROR:
                                                throw new WorkbenchHandledException("A fatal error occurred. Contact your administrator and provide the following error id:\n [$errorId]", 0);
                                default:
                                                /* Swallow and don't execute PHP internal error handler */
                                                return true;
                }
}

set_error_handler('handleAllErrors', E_STRICT);

Original comment by ryan.bra...@gmail.com on 20 Jul 2011 at 4:59

GoogleCodeExporter commented 9 years ago
r901

Original comment by ryan.bra...@gmail.com on 25 Jul 2011 at 7:47

GoogleCodeExporter commented 9 years ago

Original comment by ryan.bra...@gmail.com on 29 Aug 2011 at 5:33