Skip to content

Commit

Permalink
try, catch & finally update #2
Browse files Browse the repository at this point in the history
  • Loading branch information
gfarb committed Sep 29, 2022
1 parent 633fe65 commit 0af9798
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commands/deliverability/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
}
}
}
}

0 comments on commit 0af9798

Please sign in to comment.