mertkayacs commited on
Commit
41702d1
·
verified ·
1 Parent(s): 3b44ebf

Log why an invite call failed (tokens masked)

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -7,6 +7,7 @@ The same request body as TypeSafe's /v1/systemone works in the API tab.
7
  import html
8
  import json
9
  import os
 
10
  import threading
11
 
12
  import gradio as gr
@@ -357,6 +358,7 @@ def decide_invite(request_json: str, lang: str, code: str, request: gr.Request)
357
  except Exception as err: # noqa: BLE001
358
  with _owner_lock:
359
  _owner = None
 
360
  raise gr.Error(t["invite_spent"] if "quota" in str(err).lower() else t["invite_down"]) from None
361
 
362
 
 
7
  import html
8
  import json
9
  import os
10
+ import re
11
  import threading
12
 
13
  import gradio as gr
 
358
  except Exception as err: # noqa: BLE001
359
  with _owner_lock:
360
  _owner = None
361
+ print("invite call failed:", type(err).__name__, re.sub(r"hf_\w+", "hf_***", str(err))[:400], flush=True)
362
  raise gr.Error(t["invite_spent"] if "quota" in str(err).lower() else t["invite_down"]) from None
363
 
364