LapStore commited on
Commit
51a8240
·
1 Parent(s): 58382e3

make better error handling

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,7 +38,7 @@ async def rate_limit_exceeded(request: Request, exc):
38
  return JSONResponse(
39
  status_code=429,
40
  content={
41
- "Error": "Too Many Requests ,please just try 3 times per hour",
42
  "status": 0
43
  })
44
 
@@ -77,7 +77,7 @@ async def image_step1(request: Request,image_file: UploadFile = File(...),backgr
77
 
78
  if (output_step1[-1] == 0):
79
  return {
80
- "Error": output_step1[0],
81
  "status": output_step1[-1]
82
  }
83
 
 
38
  return JSONResponse(
39
  status_code=429,
40
  content={
41
+ "detail": "Too Many Requests ,please just try 3 times per hour",
42
  "status": 0
43
  })
44
 
 
77
 
78
  if (output_step1[-1] == 0):
79
  return {
80
+ "detail": output_step1[0],
81
  "status": output_step1[-1]
82
  }
83