Skip to content

Commit

Permalink
SMVaria: Allow raise_for_status to be false for debugging purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
idlechild committed Sep 15, 2022
1 parent 4afc9f6 commit c7f09c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyz3r/smvaria.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __init__(
self.auth = aiohttp.BasicAuth(login=username, password=password) if username and password else None
self.settings_dict = settings_dict

async def generate_game(self):
async def generate_game(self, raise_for_status=True):
try:
async for attempt in AsyncRetrying(
stop=stop_after_attempt(3),
Expand All @@ -141,7 +141,7 @@ async def generate_game(self):
url=f'{self.baseurl}/randomizerWebService',
data=self.settings,
auth=self.auth,
raise_for_status=True) as resp:
raise_for_status=raise_for_status) as resp:
req = await resp.json(content_type='text/html')
return req
except RetryError as e:
Expand All @@ -157,6 +157,7 @@ async def create(
username=None,
password=None,
settings_dict=None,
raise_for_status=True,
):
seed = cls(
skills_preset=skills_preset,
Expand All @@ -170,7 +171,7 @@ async def create(

seed.settings = await seed.get_settings()

seed.data = await seed.generate_game()
seed.data = await seed.generate_game(raise_for_status)
seed.guid = uuid.UUID(hex=seed.data['seedKey'])

return seed
Expand Down

0 comments on commit c7f09c7

Please sign in to comment.