wip: save trace for failed runs
parent
c1ab4faa81
commit
d7e4394c98
12
xactfetch.py
12
xactfetch.py
|
@ -722,7 +722,9 @@ async def amain() -> None:
|
|||
failed = False
|
||||
async with async_playwright() as pw, secrets:
|
||||
browser = await pw.chromium.launch(headless=False)
|
||||
page = await browser.new_page()
|
||||
context = await browser.new_context()
|
||||
await context.tracing.start(screenshots=True, snapshots=True)
|
||||
page = await context.new_page()
|
||||
banks = sys.argv[1:] or list(ACCOUNTS.keys())
|
||||
if 'commerce' in banks:
|
||||
if not await download_commerce(
|
||||
|
@ -734,6 +736,14 @@ async def amain() -> None:
|
|||
page, secrets, end_date, token, importer
|
||||
):
|
||||
failed = True
|
||||
if failed:
|
||||
await context.tracing.stop(path='trace.zip')
|
||||
with open('trace.zip', 'rb') as f:
|
||||
await ntfy(
|
||||
'Downloading one or more transaction lists failed.',
|
||||
attach=f.read(),
|
||||
filename='trace.zip',
|
||||
)
|
||||
raise SystemExit(1 if failed else 0)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue