public HttpResponseMessage MergeConfigFile(ConfigFileDto configFileDto) { try { _controller.MergeConfigFile(configFileDto.FileContent); return(Request.CreateResponse(HttpStatusCode.OK, new { Success = true })); } catch (Exception exc) { Logger.Error(exc); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc)); } }
public HttpResponseMessage ValidateConfigFile(ConfigFileDto configFileDto) { try { var errors = this._controller.ValidateConfigFile(configFileDto.FileName, configFileDto.FileContent); return(this.Request.CreateResponse(HttpStatusCode.OK, new { ValidationErrors = errors })); } catch (ArgumentException exc) { return(this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, exc.Message)); } catch (Exception exc) { Logger.Error(exc); return(this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc)); } }