Exemplo n.º 1
0
 public void Delete(string id)
 {
     try
     {
         LoggerUtils.WriteLog("PlansController : DELETE - request received");
         planService.Delete(id);
     }
     catch (Exception ex)
     {
         LoggerUtils.WriteLog("ERROR : PlansController : " + ex.Message + "\r" + "InnerException : " + ex.InnerException);
     }
 }
 public void RemovePlan(string accessId, int id)
 {
     try
     {
         PlanService.Delete(id);
     }
     catch (TimeoutException)
     {
         throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.RequestTimeout)
         {
             Content      = new StringContent("An error occurred, please try again or contact the administrator."),
             ReasonPhrase = "Critical Exception"
         });
     }
     catch (Exception)
     {
         throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)
         {
             Content      = new StringContent("An error occurred, please try again or contact the administrator."),
             ReasonPhrase = "Critical Exception"
         });
     }
 }