kenken999 commited on
Commit
96ce10d
1 Parent(s): 9950e2e
Files changed (1) hide show
  1. routers/webhook.py +4 -1
routers/webhook.py CHANGED
@@ -152,7 +152,7 @@ async def webhook(request: Request):
152
  #return
153
  #test case
154
  #########################################################################
155
- print("mesage is ------------------------------"+message)
156
  #if any(keyword in message for keyword in ["買取方法", "取扱商品", "本日の金価格"]):
157
  if "金価格" in message_text or "買取方法" in message_text:
158
  print("start reply -----------------------------------------------"+reply_token)
@@ -195,6 +195,9 @@ async def webhook(request: Request):
195
 
196
  except Exception as e:
197
  print(e)
 
 
 
198
  #raise するとシステムとまるのでアンコメント
199
  #raise HTTPException(status_code=500, detail=str(e))
200
  return {"status": "success", "response_content": str(e)}#, response.status_code
 
152
  #return
153
  #test case
154
  #########################################################################
155
+ print("mesage is ------------------------------"+message_text)
156
  #if any(keyword in message for keyword in ["買取方法", "取扱商品", "本日の金価格"]):
157
  if "金価格" in message_text or "買取方法" in message_text:
158
  print("start reply -----------------------------------------------"+reply_token)
 
195
 
196
  except Exception as e:
197
  print(e)
198
+ error_file = os.path.basename(__file__) # ファイル名を取得
199
+ error_line = sys._getframe(1).f_lineno # 行番号を取得
200
+ print(f"Error occurred at file {error_file} on line {error_line}: {str(e)}")
201
  #raise するとシステムとまるのでアンコメント
202
  #raise HTTPException(status_code=500, detail=str(e))
203
  return {"status": "success", "response_content": str(e)}#, response.status_code