Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."