public override async Task <CreateVolumeResponse> CreateVolume( CreateVolumeRequest request, ServerCallContext context) { CreateVolumeResponse response = new CreateVolumeResponse(); if (string.IsNullOrEmpty(request.Name)) { logger.LogDebug("Validation fail"); throw new RpcException(new Status(StatusCode.InvalidArgument, "Name cannot be empty")); } using (var _s = logger.StepInformation("{0}, name: {1}", nameof(CreateVolume), request.Name)) { try { response.Volume = await azureFileCsiService.CreateVolumeAsync( request.Name, request.ControllerCreateSecrets, request.CapacityRange); } catch (StorageException ex) { logger.LogWarning(ex, "Error from storage service"); _s.Commit(); throw new RpcException(new Status(StatusCode.InvalidArgument, ex.Message)); } catch (Exception ex) { logger.LogError(ex, "Exception in CreateVolume"); throw new RpcException(new Status(StatusCode.Internal, ex.Message)); } _s.Commit(); } return(response); }