1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Separate error for cAPI SKU failure

This commit is contained in:
Jonathan Harris 2017-10-06 13:54:49 +01:00
parent 1767df031a
commit b2f13e94c7
16 changed files with 55 additions and 1 deletions

View File

@ -232,6 +232,9 @@ try:
except companion.ServerError as e:
sys.stderr.write('Server is down\n')
sys.exit(EXIT_SERVER)
except companion.SKUError as e:
sys.stderr.write('Server SKU problem\n')
sys.exit(EXIT_SERVER)
except companion.CredentialsError as e:
sys.stderr.write('Invalid Credentials\n')
sys.exit(EXIT_CREDENTIALS)

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Chyba: Server Frontieru laguje";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Chyba: Server Frontieru SKU problém";
/* [companion.py] */
"Error: Invalid Credentials" = "Chyba: Chybné přihlašovací údaje";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Fehler: Frontier-Server ist überlastet";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Fehler: Frontier-Server SKU Problem";
/* [companion.py] */
"Error: Invalid Credentials" = "Fehler: Ungültige Anmeldedaten";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Error: Frontier server is lagging";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem";
/* [companion.py] */
"Error: Invalid Credentials" = "Error: Invalid Credentials";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Error: El servidor de Frontier está retrasado";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Error: Problema de SKU en el servidor de Frontier";
/* [companion.py] */
"Error: Invalid Credentials" = "Error: Credenciales Inválidas";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Virhe: Frontierin palvelin vastaa vanhoilla tiedoilla";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Virhe: Frontier -palvelimen SKU-ongelma";
/* [companion.py] */
"Error: Invalid Credentials" = "Virhe: kirjautuminen ei kelpaa";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Erreur : Le serveur Frontier ne répond pas";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Erreur : Le serveur Frontier a un problème de SKU";
/* [companion.py] */
"Error: Invalid Credentials" = "Erreur : Identifiants invalides";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Errore: il server Frontier sta laggando";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Errore: il server Frontier ha un problema SKU";
/* [companion.py] */
"Error: Invalid Credentials" = "Errore: Credenziali non valide";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "エラー: Frontier社のサーバが混雑しています";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "エラー: Frontier社のサーバで非ゲーム所有者と判断されました";
/* [companion.py] */
"Error: Invalid Credentials" = "エラー: 認証情報に誤りがあります";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Kļūda: Frontier serveris aizkavējas";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem";
/* [companion.py] */
"Error: Invalid Credentials" = "Kļūda: Nederīga lietotāja informācija";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Fout: Frontier server is vertraagd";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Fout: Frontier server SKU probleem";
/* [companion.py] */
"Error: Invalid Credentials" = "Fout: Ongeldige inlog gegevens";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Błąd: Serwer Frontiera laguje";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Błąd w odpowiedzi serwera autoryzacyjnego.";
/* [companion.py] */
"Error: Invalid Credentials" = "Błąd: Dane uwierzytelniające niepoprawne";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Ошибка: Сервер Фронтир лаг'ает";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem";
/* [companion.py] */
"Error: Invalid Credentials" = "Ошибка: неверное имя пользователя или пароль";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Greška: Frontier server je usporen";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Greška: SKU problem na Frontier Serveru.";
/* [companion.py] */
"Error: Invalid Credentials" = "Greška: Pogrešni kredencijali";

View File

@ -166,6 +166,9 @@
/* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */
"Error: Frontier server is lagging" = "Помилка: З`єднання з сервером гри з затримками!";
/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */
"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem";
/* [companion.py] */
"Error: Invalid Credentials" = "Помилка: Невірні облікові дані!";

View File

@ -114,6 +114,12 @@ class ServerLagging(Exception):
def __str__(self):
return unicode(self).encode('utf-8')
class SKUError(Exception):
def __unicode__(self):
return _('Error: Frontier server SKU problem') # Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'
def __str__(self):
return unicode(self).encode('utf-8')
class CredentialsError(Exception):
def __unicode__(self):
return _('Error: Invalid Credentials')
@ -193,7 +199,10 @@ class Session:
raise ServerError()
elif r.url == self.server + URL_LOGIN: # would have redirected away if success
self.dump(r)
raise CredentialsError()
if 'purchase' in r.text.lower():
raise SKUError()
else:
raise CredentialsError()
elif r.url == self.server + URL_CONFIRM: # redirected to verification page
self.state = Session.STATE_AUTH
raise VerificationRequired()