Skip to content

Commit c9dd152

Browse files
fix checking unauthorized error message
1 parent ae50de5 commit c9dd152

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/cli/domain/registry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ export default function registry(opts: RegistryOptions = {}): RegistryCli {
122122
!!parsedError.error
123123
) {
124124
errMsg = parsedError.error;
125+
} else {
126+
errMsg = parsedError as any;
125127
}
126128

127129
throw errMsg;

src/cli/facade/publish.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ const publish = ({
8989
await registry.putComponent(options);
9090
logger.ok(strings.messages.cli.PUBLISHED(options.route));
9191
} catch (err: any) {
92-
if (err === 'Unauthorized' || err.message === 'Unauthorized') {
92+
if (
93+
err === 'Unauthorized' ||
94+
err.message === 'Unauthorized' ||
95+
err.response?.body === 'Unauthorized'
96+
) {
9397
if (!!options.username || !!options.password) {
9498
logger.err(
9599
strings.errors.cli.PUBLISHING_FAIL(

0 commit comments

Comments
 (0)