Skip to content

Commit

Permalink
log errors without exceptions in query console (apache#11598)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadami10 authored Sep 15, 2023
1 parent 8abe86b commit 30dae4b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,15 @@ const getQueryResults = (params) => {
// if sql api throws error, handle here
if(typeof queryResponse === 'string'){
exceptions = queryResponse;
}
}
// if sql api returns a structured error with a `code`, handle here
if (queryResponse && queryResponse.code) {
if (queryResponse.error) {
exceptions = "Query failed with error code: " + queryResponse.code + " and error: " + queryResponse.error;
} else {
exceptions = "Query failed with error code: " + queryResponse.code + " but no logs. Please see controller logs for error.";
}
}
if (queryResponse && queryResponse.exceptions && queryResponse.exceptions.length) {
exceptions = queryResponse.exceptions as SqlException[];
}
Expand Down

0 comments on commit 30dae4b

Please sign in to comment.