mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-13 14:52:16 +00:00
fix: Print HTTP response body on errors.
This commit is contained in:
@@ -119,5 +119,5 @@ def sync(ctx: click.Context):
|
||||
for account in accounts:
|
||||
try:
|
||||
save_transactions(ctx, account)
|
||||
except Exception as e:
|
||||
error(f"[{account}] Error: Sync failed, skipping account. Exception: {e}")
|
||||
except Exception:
|
||||
error(f"[{account}] Error: Sync failed, skipping account.")
|
||||
|
||||
@@ -14,7 +14,7 @@ def get(ctx: click.Context, path: str, params: dict = {}):
|
||||
try:
|
||||
res.raise_for_status()
|
||||
except Exception as e:
|
||||
error(f"Error: {e}")
|
||||
error(f"Error: {e}\n{res.text}")
|
||||
ctx.abort()
|
||||
return res.json()
|
||||
|
||||
@@ -29,7 +29,7 @@ def post(ctx: click.Context, path: str, data: dict = {}):
|
||||
try:
|
||||
res.raise_for_status()
|
||||
except Exception as e:
|
||||
error(f"Error: {e}")
|
||||
error(f"Error: {e}\n{res.text}")
|
||||
ctx.abort()
|
||||
return res.json()
|
||||
|
||||
@@ -44,7 +44,6 @@ def put(ctx: click.Context, path: str, data: dict = {}):
|
||||
try:
|
||||
res.raise_for_status()
|
||||
except Exception as e:
|
||||
error(f"Error: {e}")
|
||||
error(res.text)
|
||||
error(f"Error: {e}\n{res.text}")
|
||||
ctx.abort()
|
||||
return res.json()
|
||||
|
||||
Reference in New Issue
Block a user