Fix unhandled promise rejection when ~/.balena is not accessible

Resolves: #2096
Change-type: patch
This commit is contained in:
Paulo Castro 2020-11-18 00:27:11 +00:00
parent ee79c87723
commit 65f053dd6e

View File

@ -84,7 +84,7 @@ export async function trackCommand(commandSignature: string) {
try { try {
const balena = getBalenaSdk(); const balena = getBalenaSdk();
const $username = await balena.auth.whoami(); const $username = await balena.auth.whoami();
storage.set('cachedUsername', { await storage.set('cachedUsername', {
token, token,
username: $username, username: $username,
} as CachedUsername); } as CachedUsername);