Skip to content

Commit de9ce9c

Browse files
committed
more error information
授权失败后,可以获得更多的错误信息
1 parent f3d190c commit de9ce9c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Deploy/Back/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def authorized():
119119
bucket.put_object_acl(path_token,oss2.OBJECT_ACL_PRIVATE)
120120
return redirect(final)
121121
except Exception as e:
122-
return e.message
122+
result={"error":e.message,"token":token,"code":code,"final":final}
123+
return json.dumps(result)
123124

124125
@app.route('/list', methods = ["GET","POST"])
125126
def list():

Serverless/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def authorized():
119119
bucket.put_object_acl(path_token,oss2.OBJECT_ACL_PRIVATE)
120120
return redirect(final)
121121
except Exception as e:
122-
return e.message
122+
result={"error":e.message,"token":token,"code":code,"final":final}
123+
return json.dumps(result)
123124

124125
@app.route('/list', methods = ["GET","POST"])
125126
def list():

0 commit comments

Comments
 (0)