Version 3.0.337

This commit is contained in:
Anja Müller-Meißner 2022-08-30 15:42:25 +02:00
parent fd0e63cf10
commit 573fe77e12
2336 changed files with 33688 additions and 86082 deletions

View file

@ -23,12 +23,12 @@
/// <param name="exception">Exception thrown if cookie is not defined.</param>
/// <returns></returns>
public static bool IsAuthcookieNotDefined(
Response.ResponseBase reponse,
string actionText,
Response.ResponseBase reponse,
string actionText,
out AuthcookieNotDefinedException exception)
{
if (reponse == null || reponse.response_state == null)
{
{
// Empty response or response withoud response state is no authcookie not defined exeception.
exception = null;
return false;

View file

@ -1,15 +1,17 @@
namespace TINK.Repository.Exception
using TINK.MultilingualResources;
namespace TINK.Repository.Exception
{
public class InvalidAuthorizationResponseException : InvalidResponseException<Response.ResponseBase>
{
/// <summary>Constructs a authorization exceptions. </summary>
/// <param name="p_strMail">Mail address to create a detailed error message.</param>
public InvalidAuthorizationResponseException(string p_strMail, Response.ResponseBase p_oResponse) :
base(string.Format("Kann Benutzer {0} nicht anmelden. Mailadresse unbekannt oder Passwort ungültig.", p_strMail), p_oResponse)
/// <param name="mail">Mail address to create a detailed error message.</param>
public InvalidAuthorizationResponseException(string mail, Response.ResponseBase response) :
base(string.Format(AppResources.ErrorMessageInvalidAuthorizationResponseException, mail), response)
{
}
/// <summary> Holds error description if user/ password combination is not valid. </summary>
public const string AUTH_FAILURE_STATUS_MESSAGE_UPPERCASE = "FAILURE: CANNOT GENERATE AUTHCOOKIE";
public const string AUTH_FAILURE_STATUS_MESSAGE_UPPERCASE = "FAILURE: CANNOT GENERATE AUTHCOOKIE";
}
}

View file

@ -23,13 +23,13 @@ namespace TINK.Repository.Exception
{
// Check if there are too many bikes requested/ booked.
var match = Regex.Match(
responseState.ToUpper(),
responseState.ToUpper(),
BOOKING_FAILURE_STATUS_MESSAGE_UPPERCASE);
if (match.Groups.Count!= 4
if (match.Groups.Count != 4
|| !int.TryParse(match.Groups[2].ToString(), out int maxBikesCount))
{
exception = null;
return false;
return false;
}
exception = new BookingDeclinedException(maxBikesCount);

View file

@ -3,15 +3,15 @@
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)
/// <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}",
p_strActionWhichFailed,
p_oResponse == null ? string.Format(" Response des Typs {0} ist null.", typeof(T).Name.ToString()) : string.Empty))
"{0}{1}",
actionWhichFailed,
response == null ? string.Format(" Response of type {0} is null.", typeof(T).Name.ToString()) : string.Empty))
{
Response = p_oResponse;
Response = response;
}
public T Response { get; private set; }
@ -27,8 +27,8 @@
{ }
/// <summary> Constructs a invalid response execption.</summary>
/// <param name="p_strMessage">Exception.</param>
public InvalidResponseException(string p_strMessage) : base(p_strMessage)
/// <param name="message">Exception.</param>
public InvalidResponseException(string message) : base(message)
{ }
}
}

View file

@ -3,6 +3,6 @@
public class UnsupportedCopriVersionDetectedException : System.Exception
{
public UnsupportedCopriVersionDetectedException() : base("Unsupported app version detected.")
{}
{ }
}
}

View file

@ -10,12 +10,12 @@ namespace TINK.Repository.Exception
public static string GetHintToPossibleExceptionsReasons
=> AppResources.ExceptionTextWebConnectFailureException;
/// <summary>
/// <summary>
/// Constructs a communication exeption object.
/// </summary>
/// <param name="p_strMessage"></param>
/// <param name="p_oException"></param>
public WebConnectFailureException(string p_strMessage, System.Exception p_oException) : base(p_strMessage, p_oException)
/// <param name="message"></param>
/// <param name="exception"></param>
public WebConnectFailureException(string message, System.Exception exception) : base(message, exception)
{
}
}

View file

@ -20,7 +20,7 @@ namespace TINK.Repository.Exception
return webException.Status == WebExceptionStatus.ConnectFailure // Happens if WLAN and mobile data is off/ Router denies internet access/ ...
|| webException.Status == WebExceptionStatus.NameResolutionFailure // Happens sometimes when not WLAN and no mobil connection are available (bad connection in lift).
|| webException.Status == WebExceptionStatus.ReceiveFailure; // Happened when modile was connected to WLAN
|| webException.Status == WebExceptionStatus.ReceiveFailure; // Happened when mobile was connected to WLAN
}
/// <summary> Gets if a exception is caused by clicking too fast.</summary>