File: InternalMappingException.cs

package info (click to toggle)
mono 6.12.0.199%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,296,836 kB
  • sloc: cs: 11,181,803; xml: 2,850,076; ansic: 699,709; cpp: 123,344; perl: 59,361; javascript: 30,841; asm: 21,853; makefile: 20,405; sh: 15,009; python: 4,839; pascal: 925; sql: 859; sed: 16; php: 1
file content (96 lines) | stat: -rw-r--r-- 3,312 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//---------------------------------------------------------------------
// <copyright file="InternalMappingException.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//
// @owner       Microsoft
// @backupOwner Microsoft
//---------------------------------------------------------------------


using System.Data.Common.Utils;
using System.Data.Mapping.ViewGeneration.Structures;
using System.Runtime.Serialization;

namespace System.Data {

    /// <summary>
    /// Mapping exception class. Note that this class has state - so if you change even
    /// its internals, it can be a breaking change
    /// </summary>
    [Serializable]
    internal class InternalMappingException : EntityException {
        // effects: constructor with default message
        #region Constructors
        /// <summary>
        /// default constructor
        /// </summary>
        internal InternalMappingException() // required ctor
            : base()
        {
        }

        /// <summary>
        /// default constructor
        /// </summary>
        /// <param name="message">localized error message</param>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] // required CTOR for exceptions.
        internal InternalMappingException(string message) // required ctor
            : base(message)
        {
        }

        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="message">localized error message</param>
        /// <param name="innerException">inner exception</param>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] // required CTOR for exceptions.
        internal InternalMappingException(string message, Exception innerException) // required ctor
            : base(message, innerException)
        {
        }

        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected InternalMappingException(SerializationInfo info, StreamingContext context) :
            base(info, context)
        {
        }

        // effects: constructor that allows a log
        internal InternalMappingException(string message, ErrorLog errorLog) : base(message) {
            EntityUtil.CheckArgumentNull(errorLog, "errorLog");
            m_errorLog =  errorLog;
        }

        // effects:  constructor that allows single mapping error
        internal InternalMappingException(string message, ErrorLog.Record record)
            : base(message) {
                EntityUtil.CheckArgumentNull(record, "record");
            m_errorLog = new ErrorLog();
            m_errorLog.AddEntry(record);
        }
        #endregion

        #region Fields
        // Keep track of mapping errors that we want to give to the
        // user in one shot
        private ErrorLog m_errorLog;
        #endregion

        #region Properties
        /// <summary>
        /// Returns the inner exceptions stored in this
        /// </summary>
        internal ErrorLog ErrorLog {
            get {
                return m_errorLog;
            }
        }
        #endregion
    }
}