Permalink
Browse files

Added returning non-zero exit code on error in Rhino.ServiceBus.Host

  • Loading branch information...
1 parent b198c6b commit 9a269c0ba25c22f5e3b8475bf728364c1e85cf93 Rafal Klys committed Sep 6, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 Rhino.ServiceBus.Host/Program.cs
@@ -20,7 +20,7 @@ public class Program
private static ILog log = LogManager.GetLogger(typeof (Program));
- public static void Main(string[] args)
+ public static int Main(string[] args)
{
var executingOptions = new ExecutingOptions();
if (Parser.ParseArguments(args, executingOptions) == false)
@@ -30,19 +30,24 @@ public static void Main(string[] args)
string.Join(" ",args));
Console.WriteLine();
Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));
- return;
+
+ return 1;
}
try
{
actions[executingOptions.Action].Execute(executingOptions);
+
+ return 0;
}
catch (Exception e)
{
log.Fatal("Host has crashed because of an error",e);
// want to put the error in the error log
if(executingOptions.Action == Action.Server)
throw;
+
+ return 2;
}
}
}

0 comments on commit 9a269c0

Please sign in to comment.