Skip to content

Commit

Permalink
fixing bug with error not showing up in footer
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Li <[email protected]>
  • Loading branch information
sejli committed Oct 21, 2024
1 parent b0aa157 commit 7be5a0d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ export function QueryResult(props: { queryStatus: QueryStatus }) {
onClick={onButtonClick}
data-test-subj="queryResultErrorBtn"
className="editor__footerItem"
flush="both"
color="danger"
>
<EuiText size="xs" color="subdued" className="editor__footerItem">
<EuiText size="xs" color="danger" className="editor__footerItem">
{i18n.translate('data.query.languageService.queryResults.error', {
defaultMessage: `Error`,
})}
Expand All @@ -167,7 +167,7 @@ export function QueryResult(props: { queryStatus: QueryStatus }) {
{i18n.translate('data.query.languageService.queryResults.reasons', {
defaultMessage: `Reasons:`,
})}
</strong>
</strong>{' '}
{props.queryStatus.body.error.reason}
</EuiText>
<EuiText size="s">
Expand All @@ -176,7 +176,7 @@ export function QueryResult(props: { queryStatus: QueryStatus }) {
{i18n.translate('data.query.languageService.queryResults.details', {
defaultMessage: `Details:`,
})}
</strong>
</strong>{' '}
{props.queryStatus.body.error.details}
</p>
</EuiText>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/public/ui/query_editor/editors/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const SingleLineInput: React.FC<SingleLineInputProps> = ({
const blurDisposable = editor.onDidBlurEditorText(() => {
blurTimeoutRef.current = setTimeout(() => {
setEditorIsFocused(false);
}, 3000);
}, 500);
});

return () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ export const useSearch = (services: DiscoverViewServices) => {
}
let errorBody;
try {
errorBody = JSON.parse(error.message);
errorBody = JSON.parse(error.body.message);
} catch (e) {
errorBody = error.message;
errorBody = error.body.message;
}

data$.next({
Expand Down

0 comments on commit 7be5a0d

Please sign in to comment.