-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#45 Properly implemented and improved exception handling and cancella…
…tion support. - Proper exceptions are now throw for errors - Exceptions that occur in a batch get wrapped in either a SqlProgramExecutionException or a SqlBatchExecutionException depending on the location.
- Loading branch information
Showing
23 changed files
with
2,288 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#region © Copyright Web Applications (UK) Ltd, 2017. All rights reserved. | ||
// Copyright (c) 2017, Web Applications UK Ltd | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// * Redistributions of source code must retain the above copyright | ||
// notice, this list of conditions and the following disclaimer. | ||
// * Redistributions in binary form must reproduce the above copyright | ||
// notice, this list of conditions and the following disclaimer in the | ||
// documentation and/or other materials provided with the distribution. | ||
// * Neither the name of Web Applications UK Ltd nor the | ||
// names of its contributors may be used to endorse or promote products | ||
// derived from this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL WEB APPLICATIONS UK LTD BE LIABLE FOR ANY | ||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
#endregion | ||
|
||
using System; | ||
using WebApplications.Utilities.Annotations; | ||
using WebApplications.Utilities.Logging; | ||
|
||
namespace WebApplications.Utilities.Database.Exceptions | ||
{ | ||
/// <summary> | ||
/// <see cref="LogContext"/> key reservations for exceptions. | ||
/// </summary> | ||
internal class ContextReservations | ||
{ | ||
/// <summary> | ||
/// The prefix reservation. | ||
/// </summary> | ||
public static readonly Guid PrefixReservation = Guid.NewGuid(); | ||
|
||
/// <summary> | ||
/// The program name context key. | ||
/// </summary> | ||
[NotNull] | ||
public static readonly string ProgramNameContextKey | ||
= LogContext.ReserveKey("SqlProgram Name", PrefixReservation); | ||
|
||
/// <summary> | ||
/// The batch ID context key. | ||
/// </summary> | ||
[NotNull] | ||
public static readonly string BatchIdContextKey | ||
= LogContext.ReserveKey("SqlBatch ID", PrefixReservation); | ||
} | ||
} |
Oops, something went wrong.