mirror of
https://github.com/henry4682/linebot_finance.git
synced 2026-05-16 04:41:52 +00:00
1. show error on line
This commit is contained in:
@@ -165,8 +165,10 @@ def save_expense(line_user_id: str, fields: dict) -> str:
|
|||||||
return reply.strip()
|
return reply.strip()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
print("❌ 儲存失敗:", e)
|
import traceback
|
||||||
return "儲存失敗,請稍後再試"
|
error_detail = traceback.format_exc() # 抓取詳細錯誤堆疊
|
||||||
|
print("❌ 儲存失敗:", error_detail)
|
||||||
|
return f"儲存失敗!錯誤訊息:\n{str(e)}" # 暫時把錯誤回傳到 Line
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user