diff --git a/app/worker.ts b/app/worker.ts index 45727e9..179afae 100644 --- a/app/worker.ts +++ b/app/worker.ts @@ -119,7 +119,18 @@ export default function start(self: ServiceWorkerGlobalScope) { message: `Existing subscription ID ${existingSubscriptionId}`, }) - const applicationServerKey = urlB64ToUint8Array(pushPublicKey) + await sendMessage({ + message: `pushPublicKey ${pushPublicKey}`, + }) + + let applicationServerKey + try { + applicationServerKey = urlB64ToUint8Array(pushPublicKey) + } catch (error) { + await sendMessage({ + message: `B64 error ${(error as Error).toString()}`, + }) + } await sendMessage({ message: `Converted public key`,