Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Catch exceptions in process_order and return error #35

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seer-by-sentry[bot]
Copy link

Fixes REACT-5DN. The issue was that: Hardcoded insufficient inventory in backend caused unhandled exception during checkout, leading to a 500 Internal Server Error.

  • Added a try-except block around the process_order function call.
  • If an exception occurs during order processing, it's captured by Sentry.
  • The function now returns a JSON response with an error message and a 400 status code if an exception occurs.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 273618

Not quite right? Click here to continue debugging with Seer.

process_order(cart)
except Exception as err:
sentry_sdk.capture_exception(err)
return jsonify({"error": str(err)}), 400

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants