예제 #1
0
 public void Delete(string id)
 {
     using (_tracer.Step("DeploymentService.Delete"))
     {
         _deploymentLock.LockHttpOperation(() =>
         {
             try
             {
                 _deploymentManager.Delete(id);
             }
             catch (DirectoryNotFoundException ex)
             {
                 var response     = new HttpResponseMessage(HttpStatusCode.NotFound);
                 response.Content = new StringContent(ex.Message);
                 throw new HttpResponseException(response);
             }
             catch (InvalidOperationException ex)
             {
                 var response     = new HttpResponseMessage(HttpStatusCode.Conflict);
                 response.Content = new StringContent(ex.Message);
                 throw new HttpResponseException(response);
             }
         });
     }
 }
예제 #2
0
 public void Delete(string id)
 {
     using (_tracer.Step("DeploymentService.Delete"))
     {
         _deploymentLock.LockHttpOperation(() =>
         {
             try
             {
                 _deploymentManager.Delete(id);
             }
             catch (DirectoryNotFoundException ex)
             {
                 throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, ex));
             }
             catch (InvalidOperationException ex)
             {
                 throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.Conflict, ex));
             }
         });
     }
 }