Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue:18 Lineage API depth -1 throws 500 error Instead of 400 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/app/v1/lineage/LineageController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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""""))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Negative depth is not supported. It is a validation error (bad request). With this change all server errors would return 404. We want to still return 500 for server errors . We should handle it in block of code where we are validating queryParams.

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
Expand Down