mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-16 01:25:41 -05:00
Reinstating the batch HasError property (#214)
This commit is contained in:
@@ -142,6 +142,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
/// </summary>
|
||||
public string ExecutionStartTimeStamp { get { return executionStartTime.ToString("o"); } }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this batch encountered an error that halted execution
|
||||
/// </summary>
|
||||
public bool HasError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this batch has been executed, regardless of success or failure
|
||||
/// </summary>
|
||||
@@ -186,7 +191,8 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
{
|
||||
Id = Id,
|
||||
Selection = Selection,
|
||||
ExecutionStart = ExecutionStartTimeStamp
|
||||
ExecutionStart = ExecutionStartTimeStamp,
|
||||
HasError = HasError
|
||||
};
|
||||
|
||||
// Add on extra details if we finished executing it
|
||||
@@ -302,15 +308,18 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
}
|
||||
catch (DbException dbe)
|
||||
{
|
||||
HasError = true;
|
||||
await UnwrapDbException(dbe);
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
// Cancellation isn't considered an error condition
|
||||
await SendMessage(SR.QueryServiceQueryCancelled, false);
|
||||
throw;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
HasError = true;
|
||||
await SendMessage(SR.QueryServiceQueryFailed(e.Message), true);
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
||||
/// </summary>
|
||||
public string ExecutionStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the batch encountered an error that halted execution
|
||||
/// </summary>
|
||||
public bool HasError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the result set within the query results
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user