@@ -20,9 +20,10 @@ public class SendGridClient : BaseClient
20
20
/// <param name="requestHeaders">A dictionary of request headers.</param>
21
21
/// <param name="version">API version, override AddVersion to customize.</param>
22
22
/// <param name="urlPath">Path to endpoint (e.g. /path/to/endpoint).</param>
23
+ /// <param name="httpErrorAsException">Indicates whether HTTP error responses should be raised as exceptions. Default is false.</param>
23
24
/// <returns>Interface to the Twilio SendGrid REST API.</returns>
24
25
public SendGridClient ( IWebProxy webProxy , string apiKey , string host = null , Dictionary < string , string > requestHeaders = null , string version = null , string urlPath = null , bool httpErrorAsException = false )
25
- : base ( webProxy , buildOptions ( apiKey , host , requestHeaders , version , urlPath ) )
26
+ : base ( webProxy , buildOptions ( apiKey , host , requestHeaders , version , urlPath , httpErrorAsException ) )
26
27
{
27
28
}
28
29
@@ -35,9 +36,10 @@ public SendGridClient(IWebProxy webProxy, string apiKey, string host = null, Dic
35
36
/// <param name="requestHeaders">A dictionary of request headers.</param>
36
37
/// <param name="version">API version, override AddVersion to customize.</param>
37
38
/// <param name="urlPath">Path to endpoint (e.g. /path/to/endpoint).</param>
39
+ /// <param name="httpErrorAsException">Indicates whether HTTP error responses should be raised as exceptions. Default is false.</param>
38
40
/// <returns>Interface to the Twilio SendGrid REST API.</returns>
39
41
public SendGridClient ( HttpClient httpClient , string apiKey , string host = null , Dictionary < string , string > requestHeaders = null , string version = null , string urlPath = null , bool httpErrorAsException = false )
40
- : base ( httpClient , buildOptions ( apiKey , host , requestHeaders , version , urlPath ) )
42
+ : base ( httpClient , buildOptions ( apiKey , host , requestHeaders , version , urlPath , httpErrorAsException ) )
41
43
{
42
44
}
43
45
@@ -51,7 +53,7 @@ public SendGridClient(HttpClient httpClient, string apiKey, string host = null,
51
53
/// <param name="urlPath">Path to endpoint (e.g. /path/to/endpoint).</param>
52
54
/// <returns>Interface to the Twilio SendGrid REST API.</returns>
53
55
public SendGridClient ( string apiKey , string host = null , Dictionary < string , string > requestHeaders = null , string version = null , string urlPath = null )
54
- : base ( buildOptions ( apiKey , host , requestHeaders , version , urlPath ) )
56
+ : base ( buildOptions ( apiKey , host , requestHeaders , version , urlPath , false ) )
55
57
{
56
58
}
57
59
@@ -76,7 +78,7 @@ public SendGridClient(HttpClient httpClient, SendGridClientOptions options)
76
78
{
77
79
}
78
80
79
- private static SendGridClientOptions buildOptions ( string apiKey , string host , Dictionary < string , string > requestHeaders , string version , string urlPath )
81
+ private static SendGridClientOptions buildOptions ( string apiKey , string host , Dictionary < string , string > requestHeaders , string version , string urlPath , bool httpErrorAsException )
80
82
{
81
83
return new SendGridClientOptions
82
84
{
@@ -85,6 +87,7 @@ private static SendGridClientOptions buildOptions(string apiKey, string host, Di
85
87
RequestHeaders = requestHeaders ?? DefaultOptions . RequestHeaders ,
86
88
Version = version ?? DefaultOptions . Version ,
87
89
UrlPath = urlPath ?? DefaultOptions . UrlPath ,
90
+ HttpErrorAsException = httpErrorAsException
88
91
} ;
89
92
}
90
93
}
0 commit comments