Skip to content

Commit

Permalink
Added support for InnerExceptions to InvalidCommandParameterException
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCodeTraveler committed Jul 7, 2019
1 parent 4ce5950 commit a046d59
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Src/AsyncAwaitBestPractices.MVVM.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>AsyncAwaitBestPractices.MVVM</id>
<version>3.0.0-pre2</version>
<version>3.0.0-pre3</version>
<title>Task Extensions for MVVM</title>
<authors>Brandon Minnick, John Thiriet</authors>
<owners>Brandon Minnick</owners>
Expand All @@ -14,14 +14,15 @@
<summary>Includes AsyncCommand and IAsyncCommand which allows ICommand to safely be used asynchronously with Task.</summary>
<tags>task,fire and forget, threading, extensions, system.threading.tasks,async,await</tags>
<dependencies>
<dependency id="AsyncAwaitBestPractices" version="3.0.0-pre2" />
<dependency id="AsyncAwaitBestPractices" version="3.0.0-pre3" />
</dependencies>
<releaseNotes>
New In This Release:
- Added support for `event Action` and `event Action&lt;T&gt;`
- Added support for `.SafeFireAndForget&lt;TException&gt;()`
- Added `SafeFireAndForgetExtensions.SetDefaultExceptionHandling(Action&lt;Exception&gt; onException)` to set a default action for every call to `SafeFireAndForget`
- Added `SafeFireAndForgetExtensions.Initialize(bool shouldAlwaysRethrowException = false)`. When set to `true` will rethrow every exception caught by `SafeFireAndForget`. Warning: `SafeFireAndForgetExtensions.Initialize(true)` is only recommended for DEBUG environments.
- Added support for `Exception innerException` to `InvalidCommandParameterException`
- Breaking Change: Changed default value to `continueOnCapturedContext = false`. This improves performance by not requiring a context switch when `.SafeFireAndForget()` and `IAsyncCommand` have completed.
</releaseNotes>
<copyright>Copyright (c) 2018 Brandon Minnick</copyright>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,28 @@ public class InvalidCommandParameterException : Exception
/// </summary>
/// <param name="excpectedType">Excpected parameter type for AsyncCommand.Execute.</param>
/// <param name="actualType">Actual parameter type for AsyncCommand.Execute.</param>
public InvalidCommandParameterException(Type excpectedType, Type actualType) : base(CreateErrorMessage(excpectedType, actualType))
/// <param name="innerException">Inner Exception</param>
public InvalidCommandParameterException(Type excpectedType, Type actualType, Exception innerException) : this(CreateErrorMessage(excpectedType, actualType), innerException)
{

}

/// <summary>
/// Initializes a new instance of the <see cref="T:TaskExtensions.MVVM.InvalidCommandParameterException"/> class.
/// </summary>
/// <param name="excpectedType">Excpected parameter type for AsyncCommand.Execute.</param>
/// <param name="actualType">Actual parameter type for AsyncCommand.Execute.</param>
public InvalidCommandParameterException(Type excpectedType, Type actualType) : this(CreateErrorMessage(excpectedType, actualType))
{

}

/// <summary>
/// Initializes a new instance of the <see cref="T:TaskExtensions.MVVM.InvalidCommandParameterException"/> class.
/// </summary>
/// <param name="message">Exception Message</param>
/// <param name="innerException">Inner Exception</param>
public InvalidCommandParameterException(string message, Exception innerException) : base(message, innerException)
{

}
Expand Down
2 changes: 1 addition & 1 deletion Src/AsyncAwaitBestPractices.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>AsyncAwaitBestPractices</id>
<version>3.0.0-pre2</version>
<version>3.0.0-pre3</version>
<title>Task Extensions for System.Threading.Tasks</title>
<authors>Brandon Minnick, John Thiriet</authors>
<owners>Brandon Minnick</owners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void RemoveEventHandler(Action<TEventArgs> action, [CallerMemberName] str
}

/// <summary>
/// Executes the event EventHandler<TEventArgs>
/// Executes the event EventHandler
/// </summary>
/// <param name="sender">Sender</param>
/// <param name="eventArgs">Event arguments</param>
Expand All @@ -89,7 +89,7 @@ public void HandleEvent(object sender, TEventArgs eventArgs, string eventName) =
EventManagerService.HandleEvent(eventName, sender, eventArgs, _eventHandlers);

/// <summary>
/// Executes the event Action<TEventArgs>
/// Executes the event Action
/// </summary>
/// <param name="eventArgs">Event arguments</param>
/// <param name="eventName">Event name</param>
Expand Down

0 comments on commit a046d59

Please sign in to comment.