Files
git-tfs/GitTfs/Core/GitTfsException.cs
T
2011-02-22 09:54:01 -05:00

44 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
namespace Sep.Git.Tfs.Core
{
public class GitTfsException : Exception
{
public IEnumerable<string> RecommendedSolutions { get; set; }
public GitTfsException(string message, IEnumerable<string> solutions, Exception e)
: base(message, e)
{
RecommendedSolutions = solutions;
}
public GitTfsException(string message, Exception e)
: base(message, e)
{}
public GitTfsException(string message, IEnumerable<string> solutions)
: base(message)
{
RecommendedSolutions = solutions;
}
public GitTfsException(string message)
: base(message)
{}
public Exception ToRethrowable()
{
return new GitTfsException(Message, RecommendedSolutions, this);
}
public GitTfsException WithRecommendation(params string [] recommendations)
{
if (RecommendedSolutions == null)
RecommendedSolutions = (IEnumerable<string>) recommendations.Clone();
else
RecommendedSolutions = RecommendedSolutions.Append<string>(recommendations);
return this;
}
}
}