Skip to content

Commit ef9d84d

Browse files
committed
fix: update generic error handler
1 parent 90b55c2 commit ef9d84d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ def sort():
8282
})
8383
except Exception as e:
8484
builtins.print = original_print
85-
return jsonify({'error': str(e)}), 500
85+
# Log the actual error server-side
86+
app.logger.error(f'Sorting error: {str(e)}')
87+
# Return generic error message to client
88+
return jsonify({'error': 'An internal server error occurred'}), 500
8689

8790
if __name__ == '__main__':
8891
app.run(debug=True, port=5001)

0 commit comments

Comments
 (0)