mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Send error result if parse error occurs during convert (#1121)
This commit is contained in:
@@ -144,6 +144,10 @@ namespace Microsoft.SqlTools.ServiceLayer.NotebookConvert
|
||||
var parser = new TSql150Parser(false);
|
||||
IList<ParseError> errors = new List<ParseError>();
|
||||
var parseResult = parser.Parse(new StringReader(sql), out errors);
|
||||
if (errors.Count > 0)
|
||||
{
|
||||
throw new Exception(string.Join(Environment.NewLine, errors.Select(error => error.Message)));
|
||||
}
|
||||
var batches = (parseResult as TSqlScript).Batches;
|
||||
var tokens = parseResult.ScriptTokenStream;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user