Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kadikraman committed Dec 20, 2024
1 parent 3c59c17 commit 102475b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/eas-cli/src/worker/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,23 @@ export async function uploadAsync(params: UploadParams): Promise<UploadResult> {
return retry(error);
}

const getErrorMessage = async () => {
const getErrorMessageAsync = async (): Promise<string> => {
const body = await response.json().catch(() => null);
return body?.error ?? `Upload of "${filePath}" failed: ${response.statusText}`;
}
};

if (
response.status === 408 ||
response.status === 409 ||
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 {
Expand Down

0 comments on commit 102475b

Please sign in to comment.