From b5393b4f400e4d60f57693321fd836a1e0184633 Mon Sep 17 00:00:00 2001 From: npatil4 Date: Sat, 17 Oct 2020 16:25:20 -0700 Subject: [PATCH] Issue:18 Lineage API depth -1 throws 500 error Instead of 404 --- api/app/v1/lineage/LineageController.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app/v1/lineage/LineageController.scala b/api/app/v1/lineage/LineageController.scala index 4e638e7..0b98f1a 100644 --- a/api/app/v1/lineage/LineageController.scala +++ b/api/app/v1/lineage/LineageController.scala @@ -100,7 +100,7 @@ class LineageController @Inject()(cc: LineageControllerComponents) // Produce a proper HTTP response for different success cases from LineageService lineage.transform { // A failure fetching lineage produces a 500 error code - case Failure(_) => Success(InternalServerError(s"""Unexpected error constructing lineage for table "$name"""")) + case Failure(_) => Success(NotFound(s"""Unexpected error constructing lineage for table "$name"""")) // A successful query that is empty produces a 404 case Success(Graph(nodes, links)) if nodes.isEmpty && links.isEmpty => Success(NotFound(s"""Table "$name" not found""")) // Any other successful query produces a 200 with the JSON graph