We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 747a7f2 commit db3059aCopy full SHA for db3059a
modifier/Wifi.cs
@@ -1,6 +1,7 @@
1
using System;
2
using System.Text;
3
using System.Xml;
4
+using System.Xml.Schema;
5
6
namespace Schneegans.Unattend;
7
@@ -207,7 +208,15 @@ void AddWifiProfile(IProfileWifiSettings settings)
207
208
string logfile = @"%TEMP%\wifi.log";
209
210
XmlDocument profile = settings.ProfileXml;
- Util.ValidateAgainstSchema(profile, "WLAN_profile_v1.xsd");
211
+ try
212
+ {
213
+ Util.ValidateAgainstSchema(profile, "WLAN_profile_v1.xsd");
214
+ }
215
+ catch (Exception e) when (e is XmlException or XmlSchemaException)
216
217
+ throw new ConfigurationException($"WLAN profile XML is invalid: {e.Message}");
218
219
+
220
AddXmlFile(profile, xmlfile);
221
222
CommandAppender appender = GetAppender(CommandConfig.Specialize);
0 commit comments