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()
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.Inner Exception: Received unexpected response code
Otherwise the sample code is wrong