Files
sqltoolsservice/src/Microsoft.SqlTools.ManagedBatchParser/ReliableConnection/SqlServerError.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

75 lines
2.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.Connection.ReliableConnection
{
/// <summary>
/// Represents an error produced by SQL Server database schema provider
/// </summary>
[Serializable]
public class SqlServerError : DataSchemaError
{
private const string SqlServerPrefix = "SQL";
private const string DefaultHelpKeyword = "vs.teamsystem.datatools.DefaultErrorMessageHelp";
public SqlServerError(string message, string document, ErrorSeverity severity)
: this(message, null, document, 0, 0, Constants.UndefinedErrorCode, severity)
{
}
public SqlServerError(string message, string document, int errorCode, ErrorSeverity severity)
: this(message, null, document, 0, 0, errorCode, severity)
{
}
public SqlServerError(Exception exception, string document, int errorCode, ErrorSeverity severity)
: this(exception, document, 0, 0, errorCode, severity)
{
}
public SqlServerError(string message, string document, int line, int column, ErrorSeverity severity)
: this(message, null, document, line, column, Constants.UndefinedErrorCode, severity)
{
}
public SqlServerError(
Exception exception,
string document,
int line,
int column,
int errorCode,
ErrorSeverity severity) :
this(exception.Message, exception, document, line, column, errorCode, severity)
{
}
public SqlServerError(
string message,
string document,
int line,
int column,
int errorCode,
ErrorSeverity severity) :
this(message, null, document, line, column, errorCode, severity)
{
}
public SqlServerError(
string message,
Exception exception,
string document,
int line,
int column,
int errorCode,
ErrorSeverity severity) :
base(message, exception, document, line, column, SqlServerPrefix, errorCode, severity)
{
this.HelpKeyword = DefaultHelpKeyword;
}
}
}