Update error when executing mongo command (#1556)

This commit is contained in:
Will Lorey 2020-06-04 11:01:49 -07:00 коммит произвёл GitHub
Родитель 7cbe733979
Коммит 0d6b93f556
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -13,6 +13,7 @@ import * as vscode from 'vscode';
import { IActionContext, IParsedError, parseError } from 'vscode-azureextensionui';
import { ext } from '../extensionVariables';
import { filterType, findType } from '../utils/array';
import { localize } from '../utils/localize';
import { nonNullProp, nonNullValue } from '../utils/nonNull';
import * as vscodeUtil from './../utils/vscodeUtils';
import { MongoFindOneResultEditor } from './editors/MongoFindOneResultEditor';
@ -104,7 +105,7 @@ async function executeCommand(context: IActionContext, command: MongoCommand): P
if (command.errors && command.errors.length > 0) {
//Currently, we take the first error pushed. Tests correlate that the parser visits errors in left-to-right, top-to-bottom.
const err = command.errors[0];
throw new Error(`Error near line ${err.range.start.line}, column ${err.range.start.character}: '${err.message}'. Please check syntax.`);
throw new Error(localize('unableToParseSyntax', `Unable to parse syntax. Error near line ${err.range.start.line}, column ${err.range.start.character}: "${err.message}"`));
}
// we don't handle chained commands so we can only handle "find" if isn't chained