mirror of https://github.com/winsw/winsw
Merge pull request #373 from NextTurn/catch
Don't print stack trace to console for user errorspull/393/head
commit
e06ae851f4
|
@ -455,6 +455,13 @@ namespace winsw
|
|||
Log.Debug("Completed. Exit code is 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)
|
||||
{
|
||||
Log.Fatal("WMI Operation failure: " + e.ErrorCode, e);
|
||||
|
|
|
@ -63,7 +63,14 @@ namespace winsw
|
|||
BaseName = baseName;
|
||||
BasePath = Path.Combine(d.FullName, BaseName);
|
||||
|
||||
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.
|
||||
Environment.SetEnvironmentVariable("BASE", d.FullName);
|
||||
|
|
Loading…
Reference in New Issue