-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApiDataException.cs
52 lines (46 loc) · 1.37 KB
/
ApiDataException.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;
using System.Web;
namespace BookingTek.API.ErrorHelper
{
/// <summary>
/// Api Data Exception
/// </summary>
[Serializable]
[DataContract]
public class ApiDataException : Exception, IApiExceptions
{
#region Public Serializable properties.
[DataMember]
public int ErrorCode { get; set; }
[DataMember]
public string ErrorDescription { get; set; }
[DataMember]
public HttpStatusCode HttpStatus { get; set; }
string reasonPhrase = "ApiDataException";
[DataMember]
public string ReasonPhrase
{
get { return this.reasonPhrase; }
set { this.reasonPhrase = value; }
}
#endregion
#region Public Constructor.
/// <summary>
/// Public constructor for Api Data Exception
/// </summary>
/// <param name="errorCode"></param>
/// <param name="errorDescription"></param>
/// <param name="httpStatus"></param>
public ApiDataException(int errorCode, string errorDescription, HttpStatusCode httpStatus)
{
ErrorCode = errorCode;
ErrorDescription = errorDescription;
HttpStatus = httpStatus;
}
#endregion
}
}