diff --git a/src/SampleTopshelfService/Program.cs b/src/SampleTopshelfService/Program.cs index 160b6e6e..fc3d6961 100644 --- a/src/SampleTopshelfService/Program.cs +++ b/src/SampleTopshelfService/Program.cs @@ -52,9 +52,9 @@ static int Main() x.AddCommandLineSwitch("throwonstop", v => throwOnStop = v); x.AddCommandLineSwitch("throwunhandled", v => throwUnhandled = v); - x.AddExceptionHandler(ex => + x.OnException((exception) => { - Console.WriteLine("Exception thrown - " + ex.Message); + Console.WriteLine("Exception thrown - " + exception.Message); }); }); } diff --git a/src/Topshelf/Configuration/HostConfigurators/HostConfigurator.cs b/src/Topshelf/Configuration/HostConfigurators/HostConfigurator.cs index bf5ce57e..93d05648 100644 --- a/src/Topshelf/Configuration/HostConfigurators/HostConfigurator.cs +++ b/src/Topshelf/Configuration/HostConfigurators/HostConfigurator.cs @@ -122,6 +122,6 @@ public interface HostConfigurator /// by Topshelf while a service is starting, running or stopping. /// /// - void AddExceptionHandler(Action callback); + void OnException(Action callback); } } \ No newline at end of file diff --git a/src/Topshelf/Configuration/HostConfigurators/HostConfiguratorImpl.cs b/src/Topshelf/Configuration/HostConfigurators/HostConfiguratorImpl.cs index 350e07ec..59bf2ee6 100644 --- a/src/Topshelf/Configuration/HostConfigurators/HostConfiguratorImpl.cs +++ b/src/Topshelf/Configuration/HostConfigurators/HostConfiguratorImpl.cs @@ -182,7 +182,7 @@ public void AddCommandLineDefinition(string name, Action callback) _commandLineOptionConfigurators.Add(configurator); } - public void AddExceptionHandler(Action callback) + public void OnException(Action callback) { _settings.ExceptionHandler = callback; }