mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 22:07:28 +02:00
Initial version.
This commit is contained in:
parent
193aaa1a56
commit
b72c67a53e
228 changed files with 25924 additions and 0 deletions
28
TINKLib/Repository/Exception/NoGPSDataException.cs
Normal file
28
TINKLib/Repository/Exception/NoGPSDataException.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using TINK.Model.Repository.Exception;
|
||||
|
||||
namespace TINK.Repository.Exception
|
||||
{
|
||||
public class NoGPSDataException : InvalidResponseException
|
||||
{
|
||||
/// <summary> COPRI response status. </summary>
|
||||
public const string RETURNBIKE_FAILURE_STATUS_MESSAGE_UPPERCASE = "FAILURE 2245: NO GPS DATA, STATE CHANGE FORBIDDEN.";
|
||||
|
||||
/// <summary> Prevents invalid use of exception. </summary>
|
||||
private NoGPSDataException() : base(typeof(NoGPSDataException).Name)
|
||||
{
|
||||
}
|
||||
|
||||
public static bool IsNoGPSData(string responseState, out NoGPSDataException exception)
|
||||
{
|
||||
// Check if there are too many bikes requested/ booked.
|
||||
if (!responseState.Trim().ToUpper().StartsWith(RETURNBIKE_FAILURE_STATUS_MESSAGE_UPPERCASE))
|
||||
{
|
||||
exception = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
exception = new NoGPSDataException();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue