Exemple #1
0
 public JsonResult Cancel(string transformName, string jobName)
 {
     try
     {
         string authToken = HomeController.GetAuthToken(Request, Response);
         using (MediaClient mediaClient = new MediaClient(authToken))
         {
             mediaClient.CancelJob(transformName, jobName);
         }
         return(Json(jobName));
     }
     catch (ValidationException ex)
     {
         Error error = new Error()
         {
             Type    = HttpStatusCode.BadRequest,
             Message = ex.Message
         };
         return(new JsonResult(error)
         {
             StatusCode = (int)error.Type
         });
     }
     catch (ApiErrorException ex)
     {
         return(new JsonResult(ex.Response.Content)
         {
             StatusCode = (int)ex.Response.StatusCode
         });
     }
 }
Exemple #2
0
 public JsonResult Cancel(string transformName, string jobName)
 {
     try
     {
         string authToken = HomeController.GetAuthToken(Request, Response);
         using (MediaClient mediaClient = new MediaClient(authToken))
         {
             mediaClient.CancelJob(transformName, jobName);
         }
         return(Json(jobName));
     }
     catch (ApiErrorException ex)
     {
         return(new JsonResult(ex.Response.Content)
         {
             StatusCode = (int)ex.Response.StatusCode
         });
     }
 }