~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/Newtonsoft.Json/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#region License
 
2
// Copyright (c) 2007 James Newton-King
 
3
//
 
4
// Permission is hereby granted, free of charge, to any person
 
5
// obtaining a copy of this software and associated documentation
 
6
// files (the "Software"), to deal in the Software without
 
7
// restriction, including without limitation the rights to use,
 
8
// copy, modify, merge, publish, distribute, sublicense, and/or sell
 
9
// copies of the Software, and to permit persons to whom the
 
10
// Software is furnished to do so, subject to the following
 
11
// conditions:
 
12
//
 
13
// The above copyright notice and this permission notice shall be
 
14
// included in all copies or substantial portions of the Software.
 
15
//
 
16
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
17
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 
18
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
19
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 
20
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 
21
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
22
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
23
// OTHER DEALINGS IN THE SOFTWARE.
 
24
#endregion
 
25
 
 
26
using System;
 
27
using System.Runtime.Serialization;
 
28
 
 
29
namespace Newtonsoft.Json.Schema
 
30
{
 
31
  /// <summary>
 
32
  /// Returns detailed information about the schema exception.
 
33
  /// </summary>
 
34
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE)
 
35
  [Serializable]
 
36
#endif
 
37
  public class JsonSchemaException : JsonException
 
38
  {
 
39
    /// <summary>
 
40
    /// Gets the line number indicating where the error occurred.
 
41
    /// </summary>
 
42
    /// <value>The line number indicating where the error occurred.</value>
 
43
    public int LineNumber { get; private set; }
 
44
 
 
45
 
 
46
    /// <summary>
 
47
    /// Gets the line position indicating where the error occurred.
 
48
    /// </summary>
 
49
    /// <value>The line position indicating where the error occurred.</value>
 
50
    public int LinePosition { get; private set; }
 
51
 
 
52
    /// <summary>
 
53
    /// Gets the path to the JSON where the error occurred.
 
54
    /// </summary>
 
55
    /// <value>The path to the JSON where the error occurred.</value>
 
56
    public string Path { get; private set; }
 
57
 
 
58
    /// <summary>
 
59
    /// Initializes a new instance of the <see cref="JsonSchemaException"/> class.
 
60
    /// </summary>
 
61
    public JsonSchemaException()
 
62
    {
 
63
    }
 
64
 
 
65
    /// <summary>
 
66
    /// Initializes a new instance of the <see cref="JsonSchemaException"/> class
 
67
    /// with a specified error message.
 
68
    /// </summary>
 
69
    /// <param name="message">The error message that explains the reason for the exception.</param>
 
70
    public JsonSchemaException(string message)
 
71
      : base(message)
 
72
    {
 
73
    }
 
74
 
 
75
    /// <summary>
 
76
    /// Initializes a new instance of the <see cref="JsonSchemaException"/> class
 
77
    /// with a specified error message and a reference to the inner exception that is the cause of this exception.
 
78
    /// </summary>
 
79
    /// <param name="message">The error message that explains the reason for the exception.</param>
 
80
    /// <param name="innerException">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>
 
81
    public JsonSchemaException(string message, Exception innerException)
 
82
      : base(message, innerException)
 
83
    {
 
84
    }
 
85
 
 
86
 #if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE)
 
87
    /// <summary>
 
88
    /// Initializes a new instance of the <see cref="JsonSchemaException"/> class.
 
89
    /// </summary>
 
90
    /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
 
91
    /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
 
92
    /// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
 
93
    /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
 
94
    public JsonSchemaException(SerializationInfo info, StreamingContext context)
 
95
      : base(info, context)
 
96
    {
 
97
    }
 
98
#endif
 
99
 
 
100
    internal JsonSchemaException(string message, Exception innerException, string path, int lineNumber, int linePosition)
 
101
      : base(message, innerException)
 
102
    {
 
103
      Path = path;
 
104
      LineNumber = lineNumber;
 
105
      LinePosition = linePosition;
 
106
    }
 
107
  }
 
108
}
 
 
b'\\ No newline at end of file'