protected void Exit(ExitCode exitCode) { if (exitCode != ExitCode.Success) { Log.Info("The application has unexpectedly terminated. Use --verbose for more information."); } environment.Exit((int)exitCode); }
public void SaveConfigState() { if (!ShiftConfigFiles()) { _logger.LogError("Unable to manage configuration files, quitting!"); _environment.Exit(10); } try { var configJson = _jsonHelper.SerializeObject(_dnsEntriesConfig, true); _file.WriteAllText(CoreConfig.ConfigFile, configJson); _logger.LogDebug("Updated configuration file"); } catch (Exception ex) { _logger.LogUnexpectedException(ex); _environment.Exit(11); } }