sharee.bike-App/TINKLib/Repository/Exception/InvalidResponseException.cs

35 lines
1.3 KiB
C#
Raw Normal View History

2021-05-13 20:03:07 +02:00
namespace TINK.Model.Repository.Exception
{
public class InvalidResponseException<T> : InvalidResponseException
{
/// <summary> Constructs an invalid response Exception. </summary>
/// <param name="p_strActionWhichFailed">Describes the action which failed.</param>
/// <param name="p_oResponse">Response from copri.</param>
public InvalidResponseException(string p_strActionWhichFailed, T p_oResponse)
: base(string.Format(
"{0}{1}",
p_strActionWhichFailed,
p_oResponse == null ? string.Format(" Response des Typs {0} ist null.", typeof(T).Name.ToString()) : string.Empty))
{
Response = p_oResponse;
}
public T Response { get; private set; }
}
/// <summary>
/// Base exception for all generic invalid response exceptions.
/// </summary>
public class InvalidResponseException : CommunicationException
{
/// <summary> Prevents an invalid instance to be created. </summary>
private InvalidResponseException()
{ }
/// <summary> Constructs a invalid response execption.</summary>
/// <param name="p_strMessage">Exception.</param>
public InvalidResponseException(string p_strMessage) : base(p_strMessage)
{ }
}
}