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

CAPI: 'SKUError' exception was never used - removed

Also LANG comments added.
This commit is contained in:
Athanasius 2021-06-13 12:42:50 +01:00
parent 3a1af1c2b2
commit f449e85c0b
2 changed files with 3 additions and 18 deletions

View File

@ -388,10 +388,6 @@ sys.path: {sys.path}'''
logger.error('Frontier CAPI Server returned an error')
sys.exit(EXIT_SERVER)
except companion.SKUError:
logger.error('Frontier CAPI Server SKU problem')
sys.exit(EXIT_SERVER)
except companion.CredentialsError:
logger.error('Frontier CAPI Server: Invalid Credentials')
sys.exit(EXIT_CREDENTIALS)

View File

@ -167,6 +167,7 @@ class ServerError(Exception):
# Raised when cannot contact the Companion API server
self.args = args
if not args:
# LANG: Frontier CAPI didn't respond
self.args = (_("Error: Frontier CAPI didn't respond"),)
@ -184,22 +185,10 @@ class ServerLagging(Exception):
def __init__(self, *args) -> None:
self.args = args
if not args:
# LANG: Frontier CAPI data doesn't agree with latest Journal location
self.args = (_('Error: Frontier server is lagging'),)
class SKUError(Exception):
"""Exception Class for CAPI SKU error.
Raised when the Companion API server thinks that the user has not
purchased E:D i.e. doesn't have the correct 'SKU'.
"""
def __init__(self, *args) -> None:
self.args = args
if not args:
self.args = (_('Error: Frontier server SKU problem'),)
class CredentialsError(Exception):
"""Exception Class for CAPI Credentials error."""
@ -526,7 +515,7 @@ class Session(object):
self.session.headers['User-Agent'] = USER_AGENT
self.state = Session.STATE_OK
def query(self, endpoint: str) -> CAPIData:
def query(self, endpoint: str) -> CAPIData: # noqa: CCR001
"""Perform a query against the specified CAPI endpoint."""
logger.trace(f'Performing query for endpoint "{endpoint}"')
if self.state == Session.STATE_INIT: