diff --git a/contributing/samples/authn-adk-all-in-one/hotel_booker_app/hotelbooker_core.py b/contributing/samples/authn-adk-all-in-one/hotel_booker_app/hotelbooker_core.py index 8bf94632d8..3858286b63 100644 --- a/contributing/samples/authn-adk-all-in-one/hotel_booker_app/hotelbooker_core.py +++ b/contributing/samples/authn-adk-all-in-one/hotel_booker_app/hotelbooker_core.py @@ -131,8 +131,9 @@ def get_available_hotels(self, cursor, location=None): cursor.execute(query, params) rows = cursor.fetchall() return [dict(row) for row in rows], None - except sqlite3.Error as e: - return None, f"Error getting available hotels: {e}" + except sqlite3.Error: + logging.exception("Database error while getting available hotels.") + return None, "An internal error occurred while retrieving available hotels." def book_a_room( self, conn, hotel_id, guest_name, check_in_date, check_out_date, num_rooms @@ -259,5 +260,6 @@ def get_booking_details(self, cursor, booking_id=None, guest_name=None): bookings = [dict(row) for row in rows] return bookings if result_type == "list" else bookings[0], None - except sqlite3.Error as e: - return None, f"Error getting booking details: {e}" + except sqlite3.Error: + logging.exception("Database error while getting booking details.") + return None, "An internal error occurred while retrieving booking details."