DeepLearning101 commited on
Commit
6e806c1
·
verified ·
1 Parent(s): 460425e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -1
main.py CHANGED
@@ -361,7 +361,11 @@ def notify_boss(name, tel, date, time, pax, email="", event="新訂位"):
361
  timeout=15
362
  )
363
  if r.status_code == 200:
364
- print(f"✅ notify_boss GAS Email 成功")
 
 
 
 
365
  else:
366
  print(f"❌ notify_boss GAS Email 失敗:HTTP {r.status_code} — {r.text[:200]}")
367
  except Exception as e:
 
361
  timeout=15
362
  )
363
  if r.status_code == 200:
364
+ body = r.json() if r.text.strip().startswith("{") else {}
365
+ if body.get("status") == "error":
366
+ print(f"❌ notify_boss GAS Email 失敗(GAS 錯誤):{body.get('message', r.text[:200])}")
367
+ else:
368
+ print(f"✅ notify_boss GAS Email 成功")
369
  else:
370
  print(f"❌ notify_boss GAS Email 失敗:HTTP {r.status_code} — {r.text[:200]}")
371
  except Exception as e: