Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 7f906bb4 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

update hashing tool to read the error message from the correct fields

parent 6616bec9
No related branches found
No related tags found
No related merge requests found
......@@ -183,8 +183,12 @@ hashingcmd.exe
{
var args = evt.ValidationEventArgs;
if (severity == XmlSeverityType.Error) {
if (args == null) {
throw new Exception(string.Format("Validation error: {0}", evt.Exception.Message), evt.Exception.InnerException);
}
throw new Exception(string.Format("Validation error: {0}" + Environment.NewLine +
"Line: {1}", args.Message, args.Exception.LineNumber), evt.Exception);
"Line: {1}", args.Message, args.Exception.LineNumber), evt.Exception);
} else {
Console.Error.WriteLine("Validation warning: {0}" + Environment.NewLine +
"Line: {1}", args.Message, args.Exception.LineNumber);
......
......@@ -285,12 +285,12 @@ namespace HashingTool.ViewModel.UserControl
(s, e) => {
Application.Current.Dispatcher.Invoke(
() => {
if (e.ValidationEventArgs == null) {
LogError(
string.Format(
"XML file does not validate against a supported version of {0}",
_expectedDocumentType.ToString()));
} else {
//if (e.ValidationEventArgs == null) {
// LogError(
// string.Format(
// "XML file does not validate against a supported version of {0}",
// _expectedDocumentType.ToString()));
//} else {
LogError(
string.Format(
"Validation {0} Line {2}: {1}",
......@@ -302,7 +302,7 @@ namespace HashingTool.ViewModel.UserControl
: "")
: e.ValidationEventArgs.Message,
e.ValidationEventArgs == null ? 0 : e.ValidationEventArgs.Exception.LineNumber));
}
//}
}
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment