Skip to content

Commit 8785f2b

Browse files
committed
Fixing up the moved references in the CSPROJ -- also fixing the minor issues
from coderabbit
1 parent 6f06b85 commit 8785f2b

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

GotenbergSharpApiClient.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FE638D0D-6A76-4BF4-AF06-D8AAB9726723}"
99
ProjectSection(SolutionItems) = preProject
1010
.editorconfig = .editorconfig
11+
README.md = README.md
1112
EndProjectSection
1213
EndProject
1314
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GotenbergSharpClient.Tests", "test\GotenbergSharpClient.Tests\GotenbergSharpClient.Tests.csproj", "{EEAF9CA2-7962-176A-E851-BF81D8DE31F0}"

src/Gotenberg.Sharp.Api.Client/Domain/Builders/Faceted/HtmlConversionBehaviorBuilder.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public HtmlConversionBehaviorBuilder SetBrowserWaitExpression(string expression)
5151
{
5252
if (expression.IsNotSet())
5353
{
54-
throw new InvalidOperationException("expression is not set");
54+
throw new ArgumentException("expression cannot be null or empty", nameof(expression));
5555
}
5656

5757
_htmlConversionBehaviors.WaitForExpression = expression;
@@ -70,7 +70,7 @@ public HtmlConversionBehaviorBuilder SetUserAgent(string userAgent)
7070
{
7171
if (userAgent.IsNotSet())
7272
{
73-
throw new InvalidOperationException("headerName is not set");
73+
throw new ArgumentException("userAgent cannot be null or empty", nameof(userAgent));
7474
}
7575

7676
_htmlConversionBehaviors.UserAgent = userAgent;
@@ -103,7 +103,7 @@ public HtmlConversionBehaviorBuilder AddAdditionalHeaders(JObject extraHeaders)
103103
{
104104
if (extraHeaders == null)
105105
{
106-
throw new InvalidOperationException("extraHeaders is null");
106+
throw new ArgumentNullException(nameof(extraHeaders));
107107
}
108108

109109
_htmlConversionBehaviors.ExtraHeaders = extraHeaders;
@@ -142,6 +142,11 @@ public HtmlConversionBehaviorBuilder AddCookie(Cookie cookie)
142142
/// <returns></returns>
143143
public HtmlConversionBehaviorBuilder SetMetadata(IDictionary<string, object> dictionary)
144144
{
145+
if (dictionary == null)
146+
{
147+
throw new ArgumentNullException(nameof(dictionary));
148+
}
149+
145150
SetMetadata(JObject.FromObject(dictionary));
146151

147152
return this;
@@ -158,7 +163,7 @@ public HtmlConversionBehaviorBuilder SetMetadata(JObject metadata)
158163
{
159164
if (metadata == null)
160165
{
161-
throw new InvalidOperationException("metadata is null");
166+
throw new ArgumentNullException(nameof(metadata));
162167
}
163168

164169
_htmlConversionBehaviors.MetaData = metadata;
@@ -209,7 +214,7 @@ public HtmlConversionBehaviorBuilder SetPdfFormat(ConversionPdfFormats format)
209214
{
210215
if (format == default)
211216
{
212-
throw new InvalidOperationException("Invalid PDF format specified");
217+
throw new ArgumentOutOfRangeException(nameof(format), "Invalid PDF format specified");
213218
}
214219

215220
_htmlConversionBehaviors.PdfFormat = format;

src/Gotenberg.Sharp.Api.Client/Gotenberg.Sharp.Api.Client.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@
103103
</ItemGroup>
104104

105105
<ItemGroup>
106-
<None Include="..\README.md" Pack="true" PackagePath="\" />
107-
<None Include="..\.editorconfig" Link=".editorconfig" />
108106
<None Include="Resources\gotenbergSharpClient-large.PNG" Pack="true" PackagePath="\" />
109107
<Resource Include="Resources\gotenbergSharpClient-large.PNG" Pack="true" PackagePath="\" />
110108
</ItemGroup>

0 commit comments

Comments
 (0)