this.requestError('Client not recognized by the server. Please contact the administrator.');
break;
caseDojoStatusCode.CLIENT_VERSION_NOT_SUPPORTED:
this.requestError(`CLI version not anymore supported by the server. Please update the CLI.\nYou can download the latest stable version (latest release without "-dev" suffix) on this page:\n${Config.gitlab.cliReleasePage}`);
break;
default:
break;
}
}
if (this.handleAuthorizationCommandErrors){
if (error.response.url&&error.response.url.indexOf(ClientsSharedConfig.apiURL)!==-1){
if (error.response.url&&error.response.url.indexOf(ClientsSharedConfig.apiURL)!==-1){
switch (error.response.status){
switch (error.response.status){
caseStatusCodes.UNAUTHORIZED:// Unauthorized
caseStatusCodes.UNAUTHORIZED:
logger.error('Session expired or inexistent. Please login again.');
this.requestError('Session expired or does not exist. Please login again.');
process.exit(1);
break;
break;
caseStatusCodes.FORBIDDEN:// Forbidden
caseStatusCodes.FORBIDDEN:
logger.error('Forbidden access.');
this.requestError('Forbidden access.');
process.exit(1);
break;
break;
}
}
}
}
}else{
}else{
this.handleCommandErrors=true;
this.handleAuthorizationCommandErrors=true;
}
}
}else{
}else{
logger.error('Error connecting to the server.');
this.requestError('Error connecting to the server. Please check your internet connection. If the problem persists, please contact the administrator.');