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

Conversation

codeatri
Copy link

@codeatri codeatri commented Oct 17, 2020

Fixes #18

Lineage API depth -1 throws 500 error. Negative depth is not supported . Instead of throwing exception it should gracefully handle the error.

With this change, it will instead throw 404 Error instead of 500 with formatted JSON string as a response error message.

cc. @soojison @sambekar15

@@ -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.

@sambekar15 sambekar15 changed the title Issue:18 Lineage API depth -1 throws 500 error Instead of 404 Issue:18 Lineage API depth -1 throws 500 error Instead of 400 Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lineage API depth -1 throws 500 error
2 participants