security: log only exception type (never secrets); generic client errors
Browse files
app.py
CHANGED
|
@@ -98,7 +98,7 @@ def api_extract():
|
|
| 98 |
try:
|
| 99 |
return jsonify(data=extract(text, schema))
|
| 100 |
except Exception as e:
|
| 101 |
-
import sys; print("extract error:",
|
| 102 |
return jsonify(error="Extraction failed — please try again."), 200
|
| 103 |
|
| 104 |
PAGE = """<!doctype html><html lang="en"><head><meta charset="utf-8">
|
|
|
|
| 98 |
try:
|
| 99 |
return jsonify(data=extract(text, schema))
|
| 100 |
except Exception as e:
|
| 101 |
+
import sys; print("extract error:", type(e).__name__, file=sys.stderr, flush=True)
|
| 102 |
return jsonify(error="Extraction failed — please try again."), 200
|
| 103 |
|
| 104 |
PAGE = """<!doctype html><html lang="en"><head><meta charset="utf-8">
|