Source:
<code>public Response reingest(@PathParam("id") String id) { AuthenticatedUser u; try { u = findAuthenticatedUserOrDie(); if (!u.isSuperuser()) { return error(Response.Status.FORBIDDEN, "This API call can be used by superusers only"); } } catch (WrappedResponse wr) { return wr.getResponse(); } DataFile dataFile; try { dataFile = findDataFileOrDie(id); } catch (WrappedResponse ex) { <START> dataFile = null; <END> } if (dataFile == null) { return error(Response.Status.NOT_FOUND, "File not found for given id."); } if (dataFile.isTabularData()) { return error(Response.Status.BAD_REQUEST, "Datafile already ingested as Tabular (as of now, this API only works on uningested datafiles)."); } Dataset dataset = dataFile.getOwner(); if (dataset == null) { return error(Response.Status.BAD_REQUEST, "Failed to locate the parent dataset for the datafile."); } boolean ingestLock = dataset.isLockedFor(DatasetLock.Reason.Ingest); if (ingestLock) { return error(Response.Status.FORBIDDEN, "Dataset already locked with an Ingest lock"); } if (!FileUtil.canIngestAsTabular(dataFile)) { return error(Response.Status.BAD_REQUEST, "Tabular ingest is not supported for this file type (id: "+id+", type: "+dataFile.getContentType()+")"); } dataFile.SetIngestScheduled(); IngestRequest ingestRequest = dataFile.getIngestRequest(); if (ingestRequest == null) { ingestRequest = new IngestRequest(); ingestRequest.setDataFile(dataFile); dataFile.setIngestRequest(ingestRequest); } dataFile.getIngestRequest().setForceTypeCheck(true); dataFile = fileService.save(dataFile); String status = ingestService.startIngestJobForSingleFile(dataFile, u); if (status != null) { return ok(status); } return ok("Datafile " + id + " queued for ingest"); }</code><technical_language>throw error here</technical_language>

Target:
public Response reingest(@PathParam("id") String id) { AuthenticatedUser u; try { u = findAuthenticatedUserOrDie(); if (!u.isSuperuser()) { return error(Response.Status.FORBIDDEN, "This API call can be used by superusers only"); } } catch (WrappedResponse wr) { return wr.getResponse(); } DataFile dataFile; try { dataFile = findDataFileOrDie(id); } catch (WrappedResponse ex) { return error(Response.Status.NOT_FOUND, "File not found for given id."); } Dataset dataset = dataFile.getOwner(); if (dataset == null) { return error(Response.Status.BAD_REQUEST, "Failed to locate the parent dataset for the datafile."); } if (dataFile.isTabularData()) { return error(Response.Status.BAD_REQUEST, "The datafile is already ingested as Tabular."); } boolean ingestLock = dataset.isLockedFor(DatasetLock.Reason.Ingest); if (ingestLock) { return error(Response.Status.FORBIDDEN, "Dataset already locked with an Ingest lock"); } if (!FileUtil.canIngestAsTabular(dataFile)) { return error(Response.Status.BAD_REQUEST, "Tabular ingest is not supported for this file type (id: "+id+", type: "+dataFile.getContentType()+")"); } dataFile.SetIngestScheduled(); if (dataFile.getIngestRequest() == null) { dataFile.setIngestRequest(new IngestRequest(dataFile)); } dataFile.getIngestRequest().setForceTypeCheck(true); dataFile = fileService.save(dataFile); String status = ingestService.startIngestJobs(new ArrayList<>(Arrays.asList(dataFile)), u); if (!StringUtil.isEmpty(status)) { return ok(status); } return ok("Datafile " + id + " queued for ingest"); }