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
16 changes: 14 additions & 2 deletions src/appdistribution/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as utils from "../utils";
import * as operationPoller from "../operation-poller";
import { Distribution } from "./distribution";
import { FirebaseError, getErrMsg } from "../error";
import { FirebaseError, getErrMsg, getErrStatus, getError } from "../error";
import { Client, ClientResponse } from "../apiv2";
import { appDistributionOrigin } from "../api";

Expand Down Expand Up @@ -117,9 +117,9 @@

try {
await this.appDistroV1Client.post(`/${releaseName}:distribute`, data);
} catch (err: any) {

Check warning on line 120 in src/appdistribution/client.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Unexpected any. Specify a different type
let errorMessage = getErrMsg(err);
const errorStatus = err?.context?.body?.error?.status;

Check warning on line 122 in src/appdistribution/client.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Unsafe member access .context on an `any` value

Check warning on line 122 in src/appdistribution/client.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Unsafe assignment of an `any` value
if (errorStatus === "FAILED_PRECONDITION") {
errorMessage = "invalid testers";
} else if (errorStatus === "INVALID_ARGUMENT") {
Expand Down Expand Up @@ -301,7 +301,19 @@
});
return response.body;
} catch (err: unknown) {
throw new FirebaseError(`Failed to create release test ${getErrMsg(err)}`);
const status = getErrStatus(err);
const msg = getErrMsg(err);
if (

Check failure on line 306 in src/appdistribution/client.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Replace `⏎········status·===·429·||⏎········msg.includes("RESOURCE_EXHAUSTED")·||⏎········msg.includes("QUOTA_EXCEEDED")⏎······` with `status·===·429·||·msg.includes("RESOURCE_EXHAUSTED")·||·msg.includes("QUOTA_EXCEEDED")`

Check failure on line 306 in src/appdistribution/client.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Replace `⏎········status·===·429·||⏎········msg.includes("RESOURCE_EXHAUSTED")·||⏎········msg.includes("QUOTA_EXCEEDED")⏎······` with `status·===·429·||·msg.includes("RESOURCE_EXHAUSTED")·||·msg.includes("QUOTA_EXCEEDED")`

Check failure on line 306 in src/appdistribution/client.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Replace `⏎········status·===·429·||⏎········msg.includes("RESOURCE_EXHAUSTED")·||⏎········msg.includes("QUOTA_EXCEEDED")⏎······` with `status·===·429·||·msg.includes("RESOURCE_EXHAUSTED")·||·msg.includes("QUOTA_EXCEEDED")`
status === 429 ||
msg.includes("RESOURCE_EXHAUSTED") ||
msg.includes("QUOTA_EXCEEDED")
) {
Comment thread
lfkellogg marked this conversation as resolved.
throw new FirebaseError(
`Quota exceeded: Failed to request test execution due to quota limits (429 RESOURCE_EXHAUSTED). Please check your project's App Testing quota usage in the Firebase console. Details: ${msg}`,
{ status: 429, original: getError(err) },
);
}
throw new FirebaseError(`Failed to create release test: ${msg}`, { original: getError(err) });
}
}

Expand Down
Loading