Repository navigation
fix(recaptcha): demo views answered 500 instead of their JSON error body #14635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -101,7 +101,7 @@ def on_signup() -> Response: | |||||||||
| } | ||||||||||
| } | ||||||||||
| ) | ||||||||||
| except ValueError or Exception as e: | ||||||||||
| except Exception as e: | ||||||||||
| return jsonify({"data": {"error_msg": str(e.__dict__)}}) | ||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
@@ -150,7 +150,7 @@ def on_login() -> Response: | |||||||||
| } | ||||||||||
| } | ||||||||||
| ) | ||||||||||
| except ValueError or Exception as e: | ||||||||||
| except Exception as e: | ||||||||||
| return jsonify({"data": {"error_msg": str(e.__dict__)}}) | ||||||||||
|
Comment on lines
+153
to
154
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
@@ -198,7 +198,7 @@ def on_store_checkout() -> Response: | |||||||||
| } | ||||||||||
| } | ||||||||||
| ) | ||||||||||
| except ValueError or Exception as e: | ||||||||||
| except Exception as e: | ||||||||||
| return jsonify({"data": {"error_msg": str(e.__dict__)}}) | ||||||||||
|
Comment on lines
+201
to
202
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
@@ -246,7 +246,7 @@ def on_comment_submit() -> Response: | |||||||||
| } | ||||||||||
| } | ||||||||||
| ) | ||||||||||
| except ValueError or Exception as e: | ||||||||||
| except Exception as e: | ||||||||||
| return jsonify({"data": {"error_msg": str(e.__dict__)}}) | ||||||||||
|
Comment on lines
+249
to
250
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
str(e.__dict__)typically returns an empty dictionary string ('{}') for standard Python exceptions because they do not store their error messages in__dict__. To return the actual error message, usestr(e)instead.