diff --git a/packages/eas-cli/src/worker/upload.ts b/packages/eas-cli/src/worker/upload.ts index f8f690c423..63f41207a9 100644 --- a/packages/eas-cli/src/worker/upload.ts +++ b/packages/eas-cli/src/worker/upload.ts @@ -109,10 +109,10 @@ export async function uploadAsync(params: UploadParams): Promise { return retry(error); } - const getErrorMessage = async () => { + const getErrorMessageAsync = async (): Promise => { const body = await response.json().catch(() => null); return body?.error ?? `Upload of "${filePath}" failed: ${response.statusText}`; - } + }; if ( response.status === 408 || @@ -120,12 +120,12 @@ export async function uploadAsync(params: UploadParams): Promise { response.status === 429 || (response.status >= 500 && response.status <= 599) ) { - return retry(new Error(await getErrorMessage())); + return retry(new Error(await getErrorMessageAsync())); } else if (response.status === 413) { const message = `Upload of "${filePath}" failed: File size exceeded the upload limit`; throw new Error(message); } else if (!response.ok) { - throw new Error(await getErrorMessage()); + throw new Error(await getErrorMessageAsync()); } return {