Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33079e4

Browse files
committed
Cleaner exception message
1 parenta7e4f1f commit33079e4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎fastcaddy/core.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def pcfg(d, path='/', method='post'):
7272
response=f(get_path(path),json=obj2dict(d))
7373
try:response.raise_for_status()
7474
exceptExceptionase:
75-
e.add_note(f'{response.status_code=}{json.loads(response.text)}')
75+
e.add_note(f"Error: '{json.loads(response.text)['error']}'")
7676
raise
7777
returnresponse.textorNone
7878

‎nbs/00_core.ipynb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
" response = f(get_path(path), json=obj2dict(d))\n",
217217
" try: response.raise_for_status()\n",
218218
" except Exception as e:\n",
219-
" e.add_note(f'{response.status_code=} {json.loads(response.text)}')\n",
219+
" e.add_note(f\"Error: '{json.loads(response.text)['error']}'\")\n",
220220
" raise\n",
221221
" return response.text or None"
222222
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp