pwa-builder / PWABuilder

The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.

Home Page:https://docs.pwabuilder.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] Better error message when failing to read icons

julamb opened this issue Β· comments

What Store were you trying to package for?

iOS

Paste your stack trace below

Status code: 500
Error: Internal Server Error
Details: System.Net.Http.HttpRequestException: Response status code does not indicate success: 415 (Unsupported Media Type).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at Microsoft.PWABuilder.IOS.Web.Services.ImageGenerator.CreateIOSImagesZip(Byte[] image, Double padding, String backgroundColor) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\ImageGenerator.cs:line 144
   at Microsoft.PWABuilder.IOS.Web.Services.ImageGenerator.InvokePwabuilderImageGeneratorService(Validated options, WebAppManifestContext webManifest) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\ImageGenerator.cs:line 67
   at Microsoft.PWABuilder.IOS.Web.Services.ImageGenerator.Generate(Validated options, WebAppManifestContext manifest, String outputDirectory) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\ImageGenerator.cs:line 60
   at Microsoft.PWABuilder.IOS.Web.Services.IOSPackageCreator.Create(Validated options) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Services\IOSPackageCreator.cs:line 69
   at Microsoft.PWABuilder.IOS.Web.Controllers.PackagesController.Create(IOSAppPackageOptions options) in D:\a\pwabuilder-ios\pwabuilder-ios\Microsoft.PWABuilder.IOS.Web\Controllers\PackagesController.cs:line 55
   at lambda_method4(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)```

Additional context

I made a mistake in my manifest icons declaration, I was linking a SVG icon with a PNG mime type:

    {
      "src": "./images/icon.svg",
      "type": "image/png",
      "sizes": "512x512"
    }

I was able to locate the error by spotting the CreateIOSImagesZip in the stack trace, but it would be easier to troubleshoot with a more explicit error message saying that we failed to read one of the icons.

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .

This issue has been marked as "needs attention πŸ‘‹" since it has not been triaged for 7 days. Please triage the issue .