-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathSparkException.cs
More file actions
42 lines (38 loc) · 1.41 KB
/
SparkException.cs
File metadata and controls
42 lines (38 loc) · 1.41 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
using System;
using System.Net.Http.Headers;
namespace SparkDotNet
{
/// <summary>
/// Provides a Spark Exception class which will return the original headers for a request
/// </summary>
public class SparkException : Exception
{
/// <summary>
/// Gets or sets the error code (HTTP status code)
/// </summary>
/// <value>The error code (HTTP status code).</value>
public int StatusCode { get; set; }
/// <summary>
/// Gets or sets the Http Response Headers
/// </summary>
/// <value>HttpResponseHeaders.</value>
public HttpResponseHeaders Headers { get; private set; }
/// <summary>
/// Gets or sets the Http Response Headers
/// </summary>
/// <value>HttpResponseHeaders.</value>
public SparkErrorContent Content { get; private set; }
/// <summary>
/// Initializes a new instance of the SparkException class.
/// </summary>
/// <param name="statusCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
/// <param name="headers">HTTP Headers.</param>
public SparkException(int statusCode, string message, SparkErrorContent content, HttpResponseHeaders headers) : base(message)
{
this.StatusCode = statusCode;
this.Content = content;
this.Headers = headers;
}
}
}