You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to turn FAILONERROR off. But that will entail significant changes to the functions that use get_response() so that they can respond to whatever gets passed back to them. Or, some additional work just within that function to log details about the error and pass back a generic error message.
This came up trying to debug an empty response from DPLA in these lines
$data = get_response($url);
$json = json_decode($data);
if (isset($json->error)) {
wp_send_json(json_encode( "There was an error: " . $json->error));
wp_die();
return;
}
Because get_response() returns nothing on a 403, the error handling never kicked in, since json_decode() barfed on the empty $data.
The text was updated successfully, but these errors were encountered:
The minimal thing to do is to change
drs-toolkit-wp-plugin/drs-tk.php
Lines 832 to 834 in c5a9286
to turn FAILONERROR off. But that will entail significant changes to the functions that use
get_response()
so that they can respond to whatever gets passed back to them. Or, some additional work just within that function to log details about the error and pass back a generic error message.This came up trying to debug an empty response from DPLA in these lines
Because get_response() returns nothing on a 403, the error handling never kicked in, since
json_decode()
barfed on the empty$data
.The text was updated successfully, but these errors were encountered: