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