Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose FunctionFailedException constructors for easier unit testing #756

Merged
merged 1 commit into from
May 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/WebJobs.Extensions.DurableTask/FunctionFailedException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ internal FunctionFailedException()
{
}

internal FunctionFailedException(string message)
/// <summary>
/// Initializes a new instance of a <see cref="FunctionFailedException"/>.
/// </summary>
/// <param name="message">A message describing where to look for more details.</param>
public FunctionFailedException(string message)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if this method really should be public. It isn't currently used in our code (but the [Serializable] attribute might require the method exists). Once we expose it as public, we can't remove it without it being a breaking change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty common to have exception types with public constructors like this. I think it's fine to make this public.

: base(message)
{
}

internal FunctionFailedException(string message, Exception innerException)
/// <summary>
/// Initializes a new instance of a <see cref="FunctionFailedException"/>.
/// </summary>
/// <param name="message">A message describing where to look for more details.</param>
/// <param name="innerException">The exception that caused the function to fail.</param>
public FunctionFailedException(string message, Exception innerException)
: base(message, innerException)
{
}
Expand Down