diff --git a/generics/constants/api-responses.js b/generics/constants/api-responses.js index 7404a87a..568265f4 100644 --- a/generics/constants/api-responses.js +++ b/generics/constants/api-responses.js @@ -134,5 +134,6 @@ module.exports = { "CERTIFICATE_GENERATION_FAILED" : "Certificate generation failed", "NOT_ELIGIBLE_FOR_CERTIFICATE" : "Project is not eligible for certificate", "ISSUER_KID_NOT_FOUND" : "Failed to fetch certificate issuer kid", - "PROJECT_SUBMITTED_FOR_REISSUE" : "Submitted for project certificate reIssue" + "PROJECT_SUBMITTED_FOR_REISSUE" : "Submitted for project certificate reIssue", + "FAILED_TO_START_RESOURCE": "There was an error in starting/joining. Please try again after some time." }; diff --git a/module/userProjects/helper.js b/module/userProjects/helper.js index 2283a2f1..3e0f7013 100644 --- a/module/userProjects/helper.js +++ b/module/userProjects/helper.js @@ -1273,7 +1273,12 @@ module.exports = class UserProjectsHelper { ) { projectCreation.data.userProfile = userProfile.data.response; addReportInfoToSolution = true; - } + } else { + throw { + message: CONSTANTS.apiResponses.FAILED_TO_START_RESOURCE, + status: HTTP_STATUS_CODE["failed_dependency"].status, + }; + } } } else { @@ -1286,7 +1291,12 @@ module.exports = class UserProjectsHelper { ) { projectCreation.data.userProfile = userProfileData.data.response; addReportInfoToSolution = true; - } + } else { + throw { + message: CONSTANTS.apiResponses.FAILED_TO_START_RESOURCE, + status: HTTP_STATUS_CODE["failed_dependency"].status, + }; + } } projectCreation.data.userRoleInformation = userRoleInformation;