mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 02:26:29 +01:00
34 lines
1.1 KiB
C#
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)
|
|
{ }
|
|
}
|
|
}
|