Skip to content

Commit

Permalink
Merge pull request #21 from Kalmai221/alert-autofix-8
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 8: Information exposure through an exception
  • Loading branch information
Kalmai221 authored Dec 2, 2024
2 parents 3e32ba2 + 9dc42cc commit 9de36d1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions flask_profiler/flask_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ def delete_all_measurements():
else:
return jsonify({"message": "No measurements found to delete."}), 404
except Exception as e:
return jsonify({"error": f"An error occurred: {str(e)}"}), 500
logging.error("An error occurred: %s", str(e))
return jsonify({"error": "An internal error has occurred."}), 500

@fp.route("/api/measurements/insert", methods=["POST"])
@login_required
Expand All @@ -308,7 +309,8 @@ def insert_measurement():
return jsonify({"message": "Failed to insert measurement."}), 500

except Exception as e:
return jsonify({"error": f"An error occurred: {str(e)}"}), 500
logging.error("An error occurred: %s", str(e))
return jsonify({"error": "An internal error has occurred."}), 500

@fp.route("/api/webhook/save", methods=["POST"])
@login_required
Expand All @@ -331,7 +333,8 @@ def save_webhook():
return jsonify({"message": "Failed to save webhook."}), 500

except Exception as e:
return jsonify({"error": f"An error occurred: {str(e)}"}), 500
logging.error("An error occurred: %s", str(e))
return jsonify({"error": "An internal error has occurred."}), 500

@fp.route("/api/webhook/get", methods=["GET"])
@login_required
Expand All @@ -347,7 +350,8 @@ def get_webhook():
return jsonify({"error": "No webhook data found."}), 404

except Exception as e:
return jsonify({"error": f"An error occurred: {str(e)}"}), 500
logging.error("An error occurred: %s", str(e))
return jsonify({"error": "An internal error has occurred."}), 500

@fp.route("/api/measurements/<measurementId>".format(urlPath))
@login_required
Expand Down

0 comments on commit 9de36d1

Please sign in to comment.