Skip to content

Commit

Permalink
Changing the name of exception callback to 'OnException(...)'
Browse files Browse the repository at this point in the history
  • Loading branch information
sstorie authored and TravisTheTechie committed Aug 19, 2016
1 parent 16bf506 commit 270e1b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/SampleTopshelfService/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ public interface HostConfigurator
/// by Topshelf while a service is starting, running or stopping.
/// </summary>
/// <param name="callback"></param>
void AddExceptionHandler(Action<Exception> callback);
void OnException(Action<Exception> callback);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void AddCommandLineDefinition(string name, Action<string> callback)
_commandLineOptionConfigurators.Add(configurator);
}

public void AddExceptionHandler(Action<Exception> callback)
public void OnException(Action<Exception> callback)
{
_settings.ExceptionHandler = callback;
}
Expand Down

0 comments on commit 270e1b2

Please sign in to comment.