Update jsonrpc4net
[CSharpForFun/.git] / jsonrpc4net / jsonrpc4net / JsonRpcClientException.cs
1 using Newtonsoft.Json.Linq;
2 using System;
3
4 namespace GumartinM.JsonRPC4NET
5 {
6         /// <summary>
7         /// Json rpc client exception.
8         /// </summary>
9     public class JsonRpcClientException : System.Exception
10     {
11         /// <summary>
12         /// The _code.
13         /// </summary>
14         private readonly int _code;
15
16         /// <summary>
17         /// The _data.
18         /// </summary>
19         private readonly JToken _data;
20
21         /// <summary>
22                 /// Initializes a new instance of the <see cref="GumartinM.JsonRPC4NET.JsonRpcClientException"/> class.
23         /// </summary>
24         /// <param name="code">Code.</param>
25         /// <param name="message">Message.</param>
26         /// <param name="data">Data.</param>
27         public JsonRpcClientException(int code, String message, JToken data)
28             : base(message)
29         {
30             _code = code;
31             _data = data;
32         }
33
34         /// <summary>
35         /// Gets the code.
36         /// </summary>
37         /// <returns>The code.</returns>
38         public int getCode()
39         {
40             return _code;
41         }
42
43         /// <summary>
44         /// Gets the data.
45         /// </summary>
46         /// <returns>The data.</returns>
47         public JToken getData()
48         {
49             return _data;
50         }
51     }
52 }