in aws-batch-schedulingpolicy/src/main/java/software/amazon/batch/schedulingpolicy/Exceptions.java [33:42]
static void handleInvalidInputException(final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext, final BatchException e) {
// Batch returns a 400 error code for resource not found instead of a 404.
// Other 400 errors are Client Exceptions and are mapped to Invalid Request Exception.
if (e.getMessage().contains(Constants.DOES_NOT_EXIST)) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, request.getDesiredResourceState().getArn(), e);
} else {
throw new CfnInvalidRequestException(e);
}
}