Skip to content

Commit

Permalink
add exception codes
Browse files Browse the repository at this point in the history
  • Loading branch information
shnrndk committed Dec 19, 2023
1 parent a561c17 commit f0b0fb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,10 @@ public enum ExceptionCodes implements ErrorHandler {
"Revision deployment request conflicted with the current deployment state of the revision %s. Please try again later", false),
INVALID_API_ID(902006, "Invalid API ID", 404, "The provided API ID is not found %s", false),
INVALID_ENDPOINT_CONFIG(902012, "Endpoint config value(s) is(are) not valid", 400, "Endpoint config value(s) is(are) not valid"),
ARTIFACT_SYNC_HTTP_REQUEST_FAILED(903009, "Error while retrieving from remote endpoint", 500, "Error while executing HTTP request to retrieve from remote endpoint");

ARTIFACT_SYNC_HTTP_REQUEST_FAILED(903009, "Error while retrieving from remote endpoint", 500, "Error while executing HTTP request to retrieve from remote endpoint"),

Check warning on line 544 in components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/ExceptionCodes.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/ExceptionCodes.java#L544

Added line #L544 was not covered by tests
// Admin portal get apis and api provider change related errors
CHANGE_API_PROVIDER_FAILED(903011, "Error while changing the API provider", 500, "Error while changing the API provider in the registry or DB"),
GET_SEARCH_APIS_IN_ADMIN_FAILED(903012, "Error while getting the apis", 500, "Error while getting/searching the apis from registry");

Check warning on line 547 in components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/ExceptionCodes.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/ExceptionCodes.java#L546-L547

Added lines #L546 - L547 were not covered by tests
private final long errorCode;
private final String errorMessage;
private final int httpStatusCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public Response providerNamePost(String provider, String apiId, MessageContext m
APIAdmin apiAdmin = new APIAdminImpl();
apiAdmin.updateApiProvider(apiId, provider, organisation);
} catch (APIManagementException e) {
throw new APIManagementException("Error while changing the API provider", e);
throw new APIManagementException("Error while changing the API provider",

Check warning on line 82 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/ApisApiServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/ApisApiServiceImpl.java#L79-L82

Added lines #L79 - L82 were not covered by tests
ExceptionCodes.CHANGE_API_PROVIDER_FAILED);
}
return Response.ok().build();

Check warning on line 85 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/ApisApiServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/ApisApiServiceImpl.java#L84-L85

Added lines #L84 - L85 were not covered by tests
}
Expand Down

0 comments on commit f0b0fb2

Please sign in to comment.