From 0af9798099d4d4f5e274d340428e57544255cc60 Mon Sep 17 00:00:00 2001 From: gfarb Date: Wed, 28 Sep 2022 20:11:21 -0400 Subject: [PATCH] try, catch & finally update #2 --- src/commands/deliverability/access.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/deliverability/access.ts b/src/commands/deliverability/access.ts index 920c0e6..d573639 100644 --- a/src/commands/deliverability/access.ts +++ b/src/commands/deliverability/access.ts @@ -109,13 +109,15 @@ export default class Access extends SfdxCommand { await accessLevelField?.select(accessLevelValue); await contentFrame?.click('#thePage\\:theForm\\:editBlock\\:buttons\\:saveBtn'); await contentFrame?.waitForSelector('#thePage\\:theForm\\:successText'); - this.ux.stopSpinner('🎉 Email Deliverability Access Level has been set!'); } catch (err) { error = String(err); } finally { await browser?.close(); - if (error !== undefined) + if (error !== undefined) { this.ux.stopSpinner(`❌ Access Level could not be set. The following error occurred:\n${String(error)}`); + } else { + this.ux.stopSpinner('🎉 Email Deliverability Access Level has been set!'); + } } } }