Files
sqltoolsservice/src/Microsoft.SqlTools.ManagedBatchParser/BatchParser/BatchParserException.cs
Karl Burtram 022282800a Move managed parser into its own project (test code coverage) (#774)
* Created New ManagedBatchParser project in .NetStandard

* Addressing PR Comments

* Resolve 'No Repository' warning.

* Move batch parser tests to integrations test project

* Fix SLN file
2019-02-07 20:13:03 -08:00

49 lines
1.4 KiB
C#

//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
public sealed class BatchParserException : Exception
{
const string ErrorCodeName = "ErrorCode";
const string BeginName = "Begin";
const string EndName = "End";
const string TextName = "Text";
const string TokenTypeName = "TokenType";
ErrorCode errorCode;
PositionStruct begin;
PositionStruct end;
string text;
LexerTokenType tokenType;
/// <summary>
/// Class for a custom exception for the Batch Parser
/// </summary>
public BatchParserException(ErrorCode errorCode, Token token, string message)
: base(message)
{
this.errorCode = errorCode;
begin = token.Begin;
end = token.End;
text = token.Text;
tokenType = token.TokenType;
}
public ErrorCode ErrorCode { get { return errorCode; } }
public PositionStruct Begin { get { return begin; } }
public PositionStruct End { get { return end; } }
public string Text { get { return text; } }
public LexerTokenType TokenType { get { return tokenType; } }
}
}