use of org.wso2.carbon.apimgt.rest.api.common.exception.BadRequestException in project carbon-apimgt by wso2.
the class RestApiUtil method handleBadRequest.
/**
* Logs the error, builds a BadRequestException with specified details and throws it
*
* @param msg error message
* @param log Log instance
* @throws BadRequestException If 400 bad request comes.
*/
public static void handleBadRequest(String msg, Logger log) throws BadRequestException {
BadRequestException badRequestException = buildBadRequestException(msg);
log.error(msg);
throw badRequestException;
}
use of org.wso2.carbon.apimgt.rest.api.common.exception.BadRequestException in project carbon-apimgt by wso2.
the class BadRequestExceptionTestCase method testGetMessage.
@Test
public void testGetMessage() throws Exception {
ErrorDTO errorDTO = new ErrorDTO();
errorDTO.setDescription(testMessage);
BadRequestException badRequestException = new BadRequestException(errorDTO);
String message = badRequestException.getMessage();
Assert.assertEquals(message, testMessage);
}
Aggregations