Skip to content

Commit c93743e

Browse files
committed
fix(errors): update error handling
1 parent 1406e5c commit c93743e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/createPersonalAccessToken.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const createPersonalAccessToken = async () => {
2626
reason,
2727
});
2828
await write(token);
29+
console.log('💯 Copied personal access token to clipboard!');
2930
} catch (error) {
3031
if (isTwoFactorAuthenticationError(error)) {
3132
const { twoFactorAuthenticationCode } = await promptTwoFactorAuthenticationCode();
@@ -37,6 +38,7 @@ const createPersonalAccessToken = async () => {
3738
twoFactorAuthenticationCode,
3839
});
3940
await write(token);
41+
console.log('💯 Copied personal access token to clipboard!');
4042
} else {
4143
throw error;
4244
}

src/executables/ghpat-create.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,13 @@
44

55
import createPersonalAccessToken from '../createPersonalAccessToken';
66

7-
createPersonalAccessToken();
7+
const execute = async () => {
8+
try {
9+
await createPersonalAccessToken();
10+
} catch (e) {
11+
console.error('😞 Rut ro, an error occurred');
12+
console.error(e);
13+
}
14+
};
15+
16+
execute();

src/usernameValidator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ const isValidUsername = async (username) => {
77
} catch (e) {
88
return false;
99
}
10-
}
10+
};
1111

12-
export default isValidUsername;
12+
export default isValidUsername;

0 commit comments

Comments
 (0)