web-push-libs / web-push-csharp

Web Push library for C#
Mozilla Public License 2.0
429 stars 108 forks source link

Wrong Exception... #29

Closed deadmann closed 6 years ago

deadmann commented 6 years ago

Instead of throwing "AggregateException" which does not include the status codes, We/I expect to receive "WebPushException" and be able to handle each status code separately Main Exception: One or more errors occurred.

at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at WebPush.WebPushClient.SendNotification(PushSubscription subscription, String payload, VapidDetails vapidDetails) at TestServiceWorkerAndPush.WebPushService.DoNotify() in C:\Users\Hassan\Documents\Visual Studio 2015\Projects\TestServiceWorkerAndPush\TestServiceWorkerAndPush\WebPushService.cs:line 45

Inner Exception: Received unexpected response code

at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) at WebPush.WebPushClient.d__15.MoveNext()

Otherwise the sample code is wrong

coryjthompson commented 6 years ago

Hi,

This has been updated in version 1.0.10. Please update on nuget and let me know how you go.

Kind Regards, Cory.

deadmann commented 6 years ago

Thank you, mine was 1.0.9