mirror of https://github.com/winsw/winsw
Don't print stack trace to console for invalid config files
parent
48d4722b58
commit
b3d4b466aa
|
@ -455,6 +455,13 @@ namespace winsw
|
||||||
Log.Debug("Completed. Exit code is 0");
|
Log.Debug("Completed. Exit code is 0");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
catch (InvalidDataException e)
|
||||||
|
{
|
||||||
|
string message = "The configuration file cound not be loaded. " + e.Message;
|
||||||
|
Log.Fatal(message, e);
|
||||||
|
Console.Error.WriteLine(message);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
catch (WmiException e)
|
catch (WmiException e)
|
||||||
{
|
{
|
||||||
Log.Fatal("WMI Operation failure: " + e.ErrorCode, e);
|
Log.Fatal("WMI Operation failure: " + e.ErrorCode, e);
|
||||||
|
|
|
@ -63,7 +63,14 @@ namespace winsw
|
||||||
BaseName = baseName;
|
BaseName = baseName;
|
||||||
BasePath = Path.Combine(d.FullName, BaseName);
|
BasePath = Path.Combine(d.FullName, BaseName);
|
||||||
|
|
||||||
dom.Load(BasePath + ".xml");
|
try
|
||||||
|
{
|
||||||
|
dom.Load(BasePath + ".xml");
|
||||||
|
}
|
||||||
|
catch (XmlException e)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException(e.Message, e);
|
||||||
|
}
|
||||||
|
|
||||||
// register the base directory as environment variable so that future expansions can refer to this.
|
// register the base directory as environment variable so that future expansions can refer to this.
|
||||||
Environment.SetEnvironmentVariable("BASE", d.FullName);
|
Environment.SetEnvironmentVariable("BASE", d.FullName);
|
||||||
|
|
Loading…
Reference in New Issue