We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5044d77 + 90eba3f commit e43540dCopy full SHA for e43540d
src/Google/Http/MediaFileUpload.php
@@ -287,6 +287,15 @@ private function getResumeUri()
287
if (200 == $code && true == $location) {
288
return $location;
289
}
290
- throw new Google_Exception("Failed to start the resumable upload");
+ $message = $code;
291
+ $body = @json_decode( $response->getResponseBody() );
292
+ if ( ! empty( $body->error->errors ) ) {
293
+ $message .= ': ';
294
+ foreach( $body->error->errors as $error ) {
295
+ $message .= "{$error->domain}, {$error->message};";
296
+ }
297
+ $message = rtrim( $message, ';' );
298
299
+ throw new Google_Exception("Failed to start the resumable upload (HTTP {$message})");
300
301
0 commit comments