mirror of https://github.com/apache/cloudstack.git
More error logging to apis
This commit is contained in:
parent
83145c38fd
commit
2547fc1f6a
|
|
@ -153,6 +153,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
|
|||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create volume");
|
||||
}
|
||||
} catch (ResourceAllocationException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_ALLOCATION_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public class DeleteNetworkGroupCmd extends BaseCmd {
|
|||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete network group");
|
||||
}
|
||||
} catch (ResourceInUseException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,10 +227,14 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to deploy vm");
|
||||
}
|
||||
} catch (ResourceUnavailableException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
|
||||
} catch (ConcurrentOperationException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
|
||||
} catch (InsufficientCapacityException ex) {
|
||||
s_logger.info(ex);
|
||||
s_logger.trace(ex);
|
||||
throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ public class DisableAccountCmd extends BaseAsyncCmd {
|
|||
AccountResponse response = _responseGenerator.createAccountResponse(result);
|
||||
response.setResponseName(getName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable account");
|
||||
}
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable account");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ public class ExtractTemplateCmd extends BaseAsyncCmd {
|
|||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to extract template");
|
||||
}
|
||||
} catch (InternalErrorException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,15 +20,11 @@ package com.cloud.api.commands;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
@Implementation(description="Set VM OS Type.", responseObject=UserVmResponse.class)
|
||||
|
|
|
|||
Loading…
Reference in New Issue