Skip to content

fix: improve Genie API error messages for access denied scenarios#168

Open
calvarjorge wants to merge 2 commits intomainfrom
jorge.calvar/friendly_genie_errors
Open

fix: improve Genie API error messages for access denied scenarios#168
calvarjorge wants to merge 2 commits intomainfrom
jorge.calvar/friendly_genie_errors

Conversation

@calvarjorge
Copy link
Contributor

Adds classifyGenieError helper that maps cryptic SDK errors to user-friendly messages for space access denied (RESOURCE_DOES_NOT_EXIST) and table access denied (FAILED state) scenarios.

Adds classifyGenieError helper that maps cryptic SDK errors to
user-friendly messages for space access denied (RESOURCE_DOES_NOT_EXIST)
and table access denied (FAILED state) scenarios.

Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
Adds classifyGenieError helper that maps cryptic SDK errors to
user-friendly messages for space access denied (RESOURCE_DOES_NOT_EXIST)
and table access denied (FAILED state) scenarios.

Signed-off-by: Jorge Calvar <jorge.calvar@databricks.com>
message.includes("failed to reach COMPLETED state") &&
message.includes("FAILED")
) {
return "You may not have access to the data tables. Please verify your table permissions.";
Copy link
Member

Choose a reason for hiding this comment

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

"Failed" sounds like a very generic message - are you sure it is always related to the data tables access?

function classifyGenieError(error: unknown): string {
const message = error instanceof Error ? error.message : String(error);

if (message.includes("RESOURCE_DOES_NOT_EXIST")) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can have an object which defines what's the API returns and what we display? WDYT? It will be easier to maintain it for future.

Copy link
Member

Choose a reason for hiding this comment

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

General question: maybe it's worth to reach to Genie Team and ask for API extension in case of error responses? WDYT?

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.

2 participants