Skip to content

Commit a3ff336

Browse files
committed
Proper rendering of error when we can't fetch job
1 parent 0cf8910 commit a3ff336

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

apps/pwabuilder/Frontend/src/script/pages/google-play-packaging-status.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ export class GooglePlayPackagingStatus extends LitElement {
146146
}
147147

148148
renderFooter(): TemplateResult {
149-
if (!this.job) {
149+
if (!this.job && !this.hasFailed) {
150150
return html``;
151151
}
152152

153-
if (this.job.status === "Failed") {
153+
if (this.job?.status === "Failed" || this.hasFailed) {
154154
const title = encodeURIComponent("Error creating Google Play package");
155155
const errorLogs = this.logs.filter(l => l.includes("[error]"));
156156
const lastErrorLog = ([...errorLogs].reverse()[0] || [...this.logs].reverse()[0] || "No longs available").replaceAll("\n", "\n> ");
157-
const body = encodeURIComponent(`I received the [following error](https://pwabuilder.com/google-play-packaging-status?jobId=${this.job.id}) when creating a Google Play package for ${this.job.packageOptions.pwaUrl}.\n\n> ${lastErrorLog}`);
157+
const body = encodeURIComponent(`I received the [following error](https://pwabuilder.com/google-play-packaging-status?jobId=${this.job.id}) when creating a Google Play package for ${this.job?.packageOptions.pwaUrl || "[empty]"}.\n\n> ${lastErrorLog}`);
158158
return html`
159159
<div class="card-footer" slot="footer">
160160
<sl-button @click="${this.retryJob}">Retry</sl-button>

0 commit comments

Comments
 (0)