Skip to content

Commit 7a4d804

Browse files
Add improvement to yield error when the requested API is not available when exporting APIs
1 parent 337a23a commit 7a4d804

File tree

1 file changed

+4
-0
lines changed
  • components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl

1 file changed

+4
-0
lines changed

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/ApisApiServiceImpl.java

+4
Original file line numberDiff line numberDiff line change
@@ -3469,6 +3469,10 @@ public Response createNewAPIVersion(String newVersion, String apiId, Boolean def
34693469
if (StringUtils.isEmpty(apiId) && (StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(version))) {
34703470
APIIdentifier apiIdentifier = new APIIdentifier(providerName, name, version);
34713471
apiId = APIUtil.getUUIDFromIdentifier(apiIdentifier, organization);
3472+
if (StringUtils.isEmpty(apiId)) {
3473+
throw new APIManagementException("API not found for the given name: " + name + ", and version : "
3474+
+ version, ExceptionCodes.from(ExceptionCodes.API_NOT_FOUND, name + "-" + version));
3475+
}
34723476
}
34733477
RuntimeArtifactDto runtimeArtifactDto = null;
34743478
if (StringUtils.isNotEmpty(organization)) {

0 commit comments

Comments
 (0)