瀏覽代碼

Use `paramName` overload of ArgumentException

Jonas Nyrup 3 年之前
父節點
當前提交
048a4748b2
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      QuestPDF/Fluent/TextExtensions.cs

+ 2 - 2
QuestPDF/Fluent/TextExtensions.cs

@@ -185,7 +185,7 @@ namespace QuestPDF.Fluent
         public TextSpanDescriptor SectionLink(string? text, string sectionName)
         public TextSpanDescriptor SectionLink(string? text, string sectionName)
         {
         {
             if (IsNullOrEmpty(sectionName))
             if (IsNullOrEmpty(sectionName))
-                throw new ArgumentException(nameof(sectionName));
+                throw new ArgumentException("Section name cannot be null or empty", nameof(sectionName));
 
 
             var style = DefaultStyle.Clone();
             var style = DefaultStyle.Clone();
             var descriptor = new TextSpanDescriptor(style);
             var descriptor = new TextSpanDescriptor(style);
@@ -212,7 +212,7 @@ namespace QuestPDF.Fluent
         public TextSpanDescriptor Hyperlink(string? text, string url)
         public TextSpanDescriptor Hyperlink(string? text, string url)
         {
         {
             if (IsNullOrEmpty(url))
             if (IsNullOrEmpty(url))
-                throw new ArgumentException(nameof(url));
+                throw new ArgumentException("Url cannot be null or empty", nameof(url));
 
 
             var style = DefaultStyle.Clone();
             var style = DefaultStyle.Clone();
             var descriptor = new TextSpanDescriptor(style);
             var descriptor = new TextSpanDescriptor(style);