feat: linebot
All checks were successful
Oracle-Deploy / redeploy (push) Successful in 30s

1. show error on line
This commit is contained in:
2026-03-23 15:49:30 +08:00
parent b09f41decc
commit d0a7f92774

View File

@@ -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()