public void CloseBatch(string batchId) { try { // Parameter Validations GeresAssertionHelper.AssertNullOrEmpty(batchId, "batchId"); // Perform the operation GeresEventSource.Log.WebApiBatchCloseReceived(batchId); _jobController.CloseBatch(batchId); GeresEventSource.Log.WebApiBatchCloseSuccessful(batchId); } catch (ArgumentException ex) { Trace.TraceWarning("WebAPI - JobController -- Invalid batch-parameter passed into system: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); GeresEventSource.Log.WebApiInvalidCloseBatchParameterReceived(batchId, ex.Message, ex.StackTrace); throw new HttpResponseException(HttpStatusCode.BadRequest); } catch (InvalidOperationException ex) { Trace.TraceWarning("WebAPI - JobController -- Batch could not be closed in system: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); GeresEventSource.Log.WebApiInvalidCloseBatchOperation(batchId, ex.Message, ex.StackTrace); throw new HttpResponseException(HttpStatusCode.BadRequest); } catch (Exception ex) { Trace.TraceError("WebAPI - JobController -- Unknown exception occured: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); GeresEventSource.Log.WebApiUnknownExceptionOccured(ex.Message, ex.StackTrace); throw new HttpResponseException(HttpStatusCode.InternalServerError); } }