mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -88,7 +88,7 @@ async function deleteDescriptor(args: ConfigArgs, apiService: any, name: string)
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam, contentTypes, accepts);
|
||||
} catch (error) {
|
||||
logger.error(`Not possible to delete the descriptor ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
logger.error(`Not possible to delete the descriptor ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error?.response?.text)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ async function deleteProject(args: ConfigArgs, apiService: any, projectId: strin
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam, contentTypes, accepts);
|
||||
} catch (error) {
|
||||
logger.error(`Not possible to delete the project ${projectId} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
logger.error(`Not possible to delete the project ${projectId} status : ${JSON.stringify(error.status)} ${JSON.stringify(error?.response?.text)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ async function undeployApplication(args: ConfigArgs, apiService: any, name: stri
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam, contentTypes, accepts);
|
||||
} catch (error) {
|
||||
logger.error(`Not possible to undeploy the applications ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
logger.error(`Not possible to undeploy the applications ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error?.response?.text)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -97,9 +97,9 @@ async function handleLoginError(loginError) {
|
||||
checkEnvReachable(loginError);
|
||||
loginAttempts++;
|
||||
if (MAX_ATTEMPTS === loginAttempts) {
|
||||
if (loginError && loginError.response && loginError.response.text) {
|
||||
if (loginError && loginError.response && loginError?.response?.text) {
|
||||
try {
|
||||
const parsedJson = JSON.parse(loginError.response.text);
|
||||
const parsedJson = JSON.parse(loginError?.response?.text);
|
||||
if (typeof parsedJson === 'object' && parsedJson.error) {
|
||||
const { stackTrace, ...errorWithoutDeprecatedProperty } = parsedJson.error;
|
||||
logger.error(errorWithoutDeprecatedProperty);
|
||||
@@ -208,9 +208,9 @@ async function getFilesCount(): Promise<number> {
|
||||
|
||||
function handleError(error) {
|
||||
logger.error(` ${red}Error encountered${reset}`);
|
||||
if (error && error.response && error.response.text) {
|
||||
if (error && error.response && error?.response?.text) {
|
||||
try {
|
||||
const parsedJson = JSON.parse(error.response.text);
|
||||
const parsedJson = JSON.parse(error?.response?.text);
|
||||
if (typeof parsedJson === 'object' && parsedJson.error) {
|
||||
const { stackTrace, ...errorWithoutDeprecatedProperty } = parsedJson.error;
|
||||
logger.error(errorWithoutDeprecatedProperty);
|
||||
|
Reference in New Issue
Block a user