private static void remove_old_chocolatey_exe(IFileSystem fileSystem) { try { fileSystem.delete_file(fileSystem.get_current_assembly_path() + ".old"); fileSystem.delete_file(fileSystem.combine_paths(AppDomain.CurrentDomain.BaseDirectory, "choco.exe.old")); } catch (Exception ex) { "chocolatey".Log().Warn("Attempting to delete choco.exe.old ran into an issue:{0} {1}".format_with(Environment.NewLine, ex.Message)); } }
private static void remove_old_chocolatey_exe(IFileSystem fileSystem) { FaultTolerance.try_catch_with_logging_exception( () => { fileSystem.delete_file(fileSystem.get_current_assembly_path() + ".old"); fileSystem.delete_file(fileSystem.combine_paths(AppDomain.CurrentDomain.BaseDirectory, "choco.exe.old")); }, errorMessage: "Attempting to delete choco.exe.old ran into an issue", throwError: false, logWarningInsteadOfError: true, logDebugInsteadOfError: false, isSilent: true ); }