public int main(string[] args) { bool error = false; Parser.Default.ParseArguments <Options>(args).WithParsed <Options>(o => { try { _config = LoadConfiguration(o); _helper = new ServiceBusHelper(_config); _topicClient = _helper.GetTopicClient(); DeadLetterProcessor deadLetterProcessor = new DeadLetterProcessor(_config); deadLetterProcessor.ProcessDeadLetters(this.ProcessDeadLetter); } catch (Exception e) { Console.WriteLine("Error: {0}", e.Message); if (null != e.InnerException) { Console.WriteLine("Inner error: {0}", e.InnerException.Message); error = true; } } }); if (true == error) { return(1); } return(0); }
static int Main(string[] args) { bool error = false; Parser.Default.ParseArguments <Options>(args).WithParsed <Options>(o => { try { Configuration config = LoadConfiguration(o); DeadLetterProcessor deadLetterProcessor = new DeadLetterProcessor(config); deadLetterProcessor.ProcessDeadLetters(); } catch (Exception e) { Console.WriteLine("Error: {0}", e.Message); if (null != e.InnerException) { Console.WriteLine("Inner error: {0}", e.InnerException.Message); error = true; } } }); if (true == error) { return(1); } return(0); }