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.
1 parent 7faa962 commit 2ee38a0Copy full SHA for 2ee38a0
src/util.ts
@@ -74,8 +74,8 @@ export async function uploadSource(
74
zipPath: string,
75
): Promise<string> {
76
const zipFile = fs.createReadStream(zipPath);
77
- const client = new Gaxios();
78
- client.request({
+ const client = new Gaxios({ retryConfig: { retry: 5 } });
+ const resp = await client.request({
79
method: 'PUT',
80
body: zipFile,
81
url: uploadUrl,
@@ -84,5 +84,10 @@ export async function uploadSource(
84
'x-goog-content-length-range': '0,104857600',
85
},
86
});
87
+ if (resp.status != 200) {
88
+ throw new Error(
89
+ `Failed to upload function source code: ${resp.statusText}`,
90
+ );
91
+ }
92
return uploadUrl;
93
}
0 commit comments