Repository navigation
Expand file tree
/
Copy pathLeanKitAPIException.cs
More file actions
42 lines (31 loc) · 1.55 KB
/
Copy pathLeanKitAPIException.cs
File metadata and controls
42 lines (31 loc) · 1.55 KB
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
//------------------------------------------------------------------------------
// <copyright company="LeanKit Inc.">
// Copyright (c) LeanKit Inc. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Runtime.Serialization;
using LeanKit.API.Client.Library.TransferObjects;
namespace LeanKit.API.Client.Library.Exceptions
{
[Serializable]
public class LeanKitAPIException : Exception
{
#region Constructors
public LeanKitAPIException() : this(null, ResponseCode.None, null) { }
public LeanKitAPIException(string message) : this(message, ResponseCode.None, null) { }
public LeanKitAPIException(string message, ResponseCode responseCode) : this(message, responseCode, null) { }
public LeanKitAPIException(ResponseCode responseCode, Exception innerException) : this(null, responseCode, innerException) { }
public LeanKitAPIException(Exception innerException) : this(null, ResponseCode.None, innerException) { }
public LeanKitAPIException(string message, ResponseCode responseCode, Exception innerException)
: base(
string.IsNullOrEmpty(message)
? (innerException != null
? innerException.Message
: "A problem occurred while communicating with the LeanKit API or during the processing of the data.")
: message, innerException) { ResponseCode = responseCode; }
protected LeanKitAPIException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
public ResponseCode ResponseCode { get; set; }
}
}