sharee.bike-App/TINKLib/Repository/Exception/InvalidResponseException.cs
Anja Müller-Meißner 0468955d49 Version 3.0.338
2022-09-08 09:55:14 +02:00

34 lines
1.1 KiB
C#

namespace TINK.Repository.Exception
{
public class InvalidResponseException<T> : InvalidResponseException
{
/// <summary> Constructs an invalid response Exception. </summary>
/// <param name="actionWhichFailed">Describes the action which failed.</param>
/// <param name="response">Response from copri.</param>
public InvalidResponseException(string actionWhichFailed, T response)
: base(string.Format(
"{0}{1}",
actionWhichFailed,
response == null ? string.Format(" Response of type {0} is null.", typeof(T).Name.ToString()) : string.Empty))
{
Response = response;
}
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="message">Exception.</param>
public InvalidResponseException(string message) : base(message)
{ }
}
}