File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/contentstack-utilities/src Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,15 @@ class AuthenticationHandler {
2828 ux . print ( 'Session timed out, please login to proceed' , {
2929 color : 'yellow' ,
3030 } ) ;
31- process . exit ( 1 ) ;
31+ throw new Error ( 'Session timed out, please login to proceed' ) ;
3232 }
3333 break ;
3434 }
3535 } catch ( error ) {
3636 ux . print ( `Error occurred while fetching auth details: ${ error . message } ` , {
3737 color : 'red' ,
3838 } ) ;
39- process . exit ( 1 ) ;
39+ throw new Error ( `Error occurred while fetching auth details: ${ error . message } ` ) ;
4040 }
4141 }
4242
@@ -87,7 +87,7 @@ class AuthenticationHandler {
8787 ux . print ( 'Max retry count reached, please login to proceed' , {
8888 color : 'yellow' ,
8989 } ) ;
90- process . exit ( 1 ) ;
90+ return ;
9191 }
9292 maxRetryCount ++ ; // Increment for the next retry attempt
9393 // These cases require a wait, adding a delay before retrying
@@ -106,7 +106,7 @@ class AuthenticationHandler {
106106 ux . print ( 'Session timed out, please login to proceed' , {
107107 color : 'yellow' ,
108108 } ) ;
109- process . exit ( ) ;
109+ resolve ( false ) ;
110110 } else if ( this . authType === 'OAUTH' ) {
111111 authHandler . host = hostName ;
112112 // NOTE Handle OAuth refresh token
@@ -124,7 +124,7 @@ class AuthenticationHandler {
124124 ux . print ( 'You do not have the permissions to perform this action, please login to proceed' , {
125125 color : 'yellow' ,
126126 } ) ;
127- process . exit ( ) ;
127+ resolve ( false ) ;
128128 }
129129 } ) ;
130130 }
You can’t perform that action at this time.
0 commit comments