File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -106,11 +106,11 @@ export default function registry(opts: RegistryOptions = {}): RegistryCli {
106106 try {
107107 await put ( options . route , options . path , requestsHeaders ) ;
108108 } catch ( err ) {
109- let parsedError = err as any as { code ?: string ; error ?: string } ;
109+ let parsedError = ( err as any ) . response . body || ( err as any ) ;
110110 let errMsg = '' ;
111- if ( ! _ . isObject ( err ) ) {
111+ if ( ! _ . isObject ( parsedError ) ) {
112112 try {
113- parsedError = JSON . parse ( String ( err ) ) ;
113+ parsedError = JSON . parse ( String ( parsedError ) ) ;
114114 } catch ( er ) { }
115115 }
116116
Original file line number Diff line number Diff line change @@ -89,11 +89,7 @@ const publish = ({
8989 await registry . putComponent ( options ) ;
9090 logger . ok ( strings . messages . cli . PUBLISHED ( options . route ) ) ;
9191 } catch ( err : any ) {
92- if (
93- err === 'Unauthorized' ||
94- err . message === 'Unauthorized' ||
95- err . response ?. body === 'Unauthorized'
96- ) {
92+ if ( err === 'Unauthorized' || err . message === 'Unauthorized' ) {
9793 if ( ! ! options . username || ! ! options . password ) {
9894 logger . err (
9995 strings . errors . cli . PUBLISHING_FAIL (
You can’t perform that action at this time.
0 commit comments