Search in sources :

Example 21 with ServiceErrorRestRep

use of com.emc.storageos.model.errorhandling.ServiceErrorRestRep in project coprhd-controller by CoprHD.

the class ServiceErrorFactory method toServiceErrorRestRep.

@Deprecated
public static ServiceErrorRestRep toServiceErrorRestRep(final ServiceCode code, final String details, final Locale locale) {
    final ServiceErrorRestRep error = new ServiceErrorRestRep();
    error.setCode(code.getCode());
    error.setRetryable(code.isRetryable());
    error.setCodeDescription(code.getSummary(locale));
    error.setDetailedMessage(details);
    return error;
}
Also used : ServiceErrorRestRep(com.emc.storageos.model.errorhandling.ServiceErrorRestRep)

Example 22 with ServiceErrorRestRep

use of com.emc.storageos.model.errorhandling.ServiceErrorRestRep in project coprhd-controller by CoprHD.

the class ApiTestTenants method validateRoleAssignmentBadRequest.

private void validateRoleAssignmentBadRequest(int expectedStatus, String expectedErrorMsg, ClientResponse actual) {
    Assert.assertNotNull(actual);
    Assert.assertEquals(expectedStatus, actual.getStatus());
    final ServiceErrorRestRep actualErrorMsg = actual.getEntity(ServiceErrorRestRep.class);
    Assert.assertTrue(actualErrorMsg.getDetailedMessage().startsWith(expectedErrorMsg));
}
Also used : ServiceErrorRestRep(com.emc.storageos.model.errorhandling.ServiceErrorRestRep)

Aggregations

ServiceErrorRestRep (com.emc.storageos.model.errorhandling.ServiceErrorRestRep)22 ClientResponse (com.sun.jersey.api.client.ClientResponse)8 AuthSvcInternalApiClientIterator (com.emc.storageos.security.authentication.AuthSvcInternalApiClientIterator)4 SecurityException (com.emc.storageos.security.exceptions.SecurityException)4 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)4 ClientHandlerException (com.sun.jersey.api.client.ClientHandlerException)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 FatalSecurityException (com.emc.storageos.security.exceptions.FatalSecurityException)3 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)3 ServiceErrorException (com.emc.vipr.client.exceptions.ServiceErrorException)2 Response (javax.ws.rs.core.Response)2 CustomConfigPreviewRep (com.emc.storageos.model.customconfig.CustomConfigPreviewRep)1 GeoException (com.emc.storageos.security.geo.exceptions.GeoException)1 ServiceErrorFactory.toServiceErrorRestRep (com.emc.storageos.svcs.errorhandling.resources.ServiceErrorFactory.toServiceErrorRestRep)1 ViPRHttpException (com.emc.vipr.client.exceptions.ViPRHttpException)1 Locale (java.util.Locale)1 ResponseBuilder (javax.ws.rs.core.Response.ResponseBuilder)1 StatusType (javax.ws.rs.core.Response.StatusType)1