protected override List <CloudPlatformResponse> CleanUpStorageResources()
        {
            List <CloudPlatformResponse> cloudPlatformResponses = null;

            try
            {
                cloudPlatformResponses = new List <CloudPlatformResponse>
                {
                    { CloudPlatformController.DeleteMessages(new CloudPlatformRequest()
                        {
                            Source = SourceQueue
                        }) },
                    { CloudPlatformController.DeleteMessages(new CloudPlatformRequest()
                        {
                            Source = TargetQueue
                        }) }
                };
            }
            catch (Exception e)
            {
                var webException = e.InnerException as WebException;
                if (webException != null)
                {
                    if (webException.Status == WebExceptionStatus.ProtocolError && webException.Message.Contains("400"))
                    {
                        throw new Exception(String.Format("Error: 404 when deleting message from queue. Check that queues exist: {0} {1}", SourceQueue, TargetQueue));
                    }
                }
                throw;
            }
            return(cloudPlatformResponses);
        }
Exemplo n.º 2
0
        protected override List <CloudPlatformResponse> CleanUpStorageResources()
        {
            var responses = new List <CloudPlatformResponse>();
            List <CloudPlatformResponse> cloudPlatformResponses = null;

            try
            {
                cloudPlatformResponses = new List <CloudPlatformResponse>
                {
                    { CloudPlatformController.DeleteMessages(new CloudPlatformRequest()
                        {
                            Source = TargetQueue
                        }) }
                };
                responses.AddRange(cloudPlatformResponses);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
            return(responses);
        }