Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/php/class-api-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Sgdg\Vendor\Google\Service\Drive\FileList;
use Sgdg\Vendor\Google\Service\Exception as Google_Service_Exception;
use Sgdg\Vendor\Google\Task\Runner;
use Sgdg\Vendor\GuzzleHttp\Exception\TransferException;
use Sgdg\Vendor\GuzzleHttp\Promise\Promise;
use Sgdg\Vendor\GuzzleHttp\Promise\PromiseInterface;
use Sgdg\Vendor\GuzzleHttp\Promise\Utils;
Expand Down Expand Up @@ -321,7 +322,12 @@ private static function execute_current_batch() {
),
'Batch Drive call',
static function () use ( $batch ) {
$ret = $batch->execute();
try {
$ret = $batch->execute();
} catch ( TransferException $e ) {
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Google_Service_Exception( $e->getMessage() );
}

foreach ( $ret as $response ) {
$exception = self::wrap_response_exception( $response );
Expand Down
Loading