link to error docs (#13094)

This commit is contained in:
Vadim Ogievetsky 2022-09-15 15:06:08 -07:00 committed by GitHub
parent c32bf0df65
commit 078b50ebe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 10 deletions

View File

@ -576,13 +576,6 @@ export class WorkbenchQuery {
apiQuery.query = queryPrepend + apiQuery.query + queryAppend;
}
const m = /(--:context\s.+)(?:\n|$)/.exec(apiQuery.query);
if (m) {
throw new Error(
`This query contains a context comment '${m[1]}'. Context comments have been deprecated. Please rewrite the context comment as a context parameter. The context parameter editor is located in the "Engine" dropdown.`,
);
}
const ingestQuery = this.isIngestQuery();
if (!unlimited && !ingestQuery) {
apiQuery.context ||= {};

View File

@ -63,6 +63,7 @@ export type LinkNames =
| 'DOCS_SQL'
| 'DOCS_RUNE'
| 'DOCS_API'
| 'DOCS_MSQ_ERROR'
| 'COMMUNITY'
| 'SLACK'
| 'USER_GROUP'
@ -82,6 +83,8 @@ export function getLink(linkName: LinkNames): string {
return `${links.docsHref}/querying/querying.html`;
case 'DOCS_API':
return `${links.docsHref}/operations/api-reference.html`;
case 'DOCS_MSQ_ERROR':
return `${links.docsHref}/multi-stage-query/concepts.html#error-codes`;
case 'COMMUNITY':
return links.communityHref;
case 'SLACK':

View File

@ -8,7 +8,12 @@ exports[`ExecutionErrorPane matches snapshot 1`] = `
<p
className="error-message-text"
>
TooManyWarnings:
<Memo(ExternalLink)
href="https://druid.apache.org/docs/latest/multi-stage-query/concepts.html#error-codes"
>
TooManyWarnings
</Memo(ExternalLink)>
:
Too many warnings of type CannotParseExternalData generated (max = 10)
</p>
<div>

View File

@ -20,9 +20,10 @@ import { Callout } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import React, { useState } from 'react';
import { ClickToCopy } from '../../../components';
import { ClickToCopy, ExternalLink } from '../../../components';
import { ShowValueDialog } from '../../../dialogs/show-value-dialog/show-value-dialog';
import { Execution } from '../../../druid-models';
import { getLink } from '../../../links';
import { downloadQueryDetailArchive } from '../../../utils';
import './execution-error-pane.scss';
@ -43,7 +44,12 @@ export const ExecutionErrorPane = React.memo(function ExecutionErrorPane(
return (
<Callout className="execution-error-pane" icon={IconNames.ERROR}>
<p className="error-message-text">
{error.errorCode && <>{`${error.errorCode}: `}</>}
{error.errorCode && (
<>
<ExternalLink href={getLink('DOCS_MSQ_ERROR')}>{error.errorCode}</ExternalLink>
{': '}
</>
)}
{error.errorMessage || (exceptionStackTrace || '').split('\n')[0]}
{exceptionStackTrace && (
<>