1 //---------------------------------------------------------------------
2 // <copyright file="ExceptionHelpers.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
8 //---------------------------------------------------------------------
11 using System.Data.Mapping.ViewGeneration.Structures;
12 using System.Diagnostics;
13 using System.Data.Common.Utils;
15 namespace System.Data.Mapping.ViewGeneration.Utils
18 // Miscellaneous helper routines for generating mapping exceptions
19 internal static class ExceptionHelpers
21 internal static void ThrowMappingException(ErrorLog.Record errorRecord, ConfigViewGenerator config)
23 InternalMappingException exception = new InternalMappingException(errorRecord.ToUserString(), errorRecord);
24 if (config.IsNormalTracing)
26 exception.ErrorLog.PrintTrace();
31 internal static void ThrowMappingException(ErrorLog errorLog, ConfigViewGenerator config)
33 InternalMappingException exception = new InternalMappingException(errorLog.ToUserString(), errorLog);
34 if (config.IsNormalTracing)
36 exception.ErrorLog.PrintTrace();