Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report an Error when iconUrl is not 200 #93

Merged

Conversation

andreban
Copy link
Member

@andreban andreban commented Feb 1, 2020

  • When status is not 200, the generation fails with an unclear
    error message.
  • Added an explicit check for the status, with a message that is
    easier to read.

- When status is not 200, the generation fails with an unclear
  error message.
- Added an explicit check for the status, with a message that is
  easier to read.
@andreban andreban requested a review from PEConn February 1, 2020 07:30
@@ -168,6 +168,9 @@ export class TwaGenerator {
*/
private async fetchIcon(iconUrl: string): Promise<Icon> {
const response = await fetch(iconUrl);
if (response.status !== 200) {
throw new Error(`Failed to download icon ${iconUrl}, with status ${response.status}`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you say "Responded with status ..." instead of just "with status"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@andreban andreban merged commit 5720e99 into GoogleChromeLabs:master Feb 3, 2020
@andreban andreban deleted the report-error-on-image-404 branch February 13, 2020 08:14
@andreban andreban added the bug Something isn't working label Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants