Skip to content

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

Open
codeatri wants to merge 1 commit intointuit:masterfrom
codeatri:Issue18-ValidationError
Open

Issue:18 Lineage API depth -1 throws 500 error Instead of 400#29
codeatri wants to merge 1 commit intointuit:masterfrom
codeatri:Issue18-ValidationError

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

// 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