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()
|
||||
except Exception as e:
|
||||
db.rollback()
|
||||
print("❌ 儲存失敗:", e)
|
||||
return "儲存失敗,請稍後再試"
|
||||
import traceback
|
||||
error_detail = traceback.format_exc() # 抓取詳細錯誤堆疊
|
||||
print("❌ 儲存失敗:", error_detail)
|
||||
return f"儲存失敗!錯誤訊息:\n{str(e)}" # 暫時把錯誤回傳到 Line
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user