Skip to content

Scheduling infrastructure for absolutely everyone.

fix: update error handling in validateBookingTimeIsNotOutOfBounds function to use HttpError (#20386)

Udit Takkar7aa1d8035c12
diff --git a/packages/features/bookings/lib/handleNewBooking/validateBookingTimeIsNotOutOfBounds.ts b/packages/features/bookings/lib/handleNewBooking/validateBookingTimeIsNotOutOfBounds.ts
index 10b1777dd8d..87d658adf15 100644
--- a/packages/features/bookings/lib/handleNewBooking/validateBookingTimeIsNotOutOfBounds.ts
+++ b/packages/features/bookings/lib/handleNewBooking/validateBookingTimeIsNotOutOfBounds.ts
@@ -52,5 +52,5 @@ export const validateBookingTimeIsNotOutOfBounds = async <T extends ValidateBook
}
}
- if (timeOutOfBounds) throw new Error(ErrorCode.BookingTimeOutOfBounds);
+ if (timeOutOfBounds) throw new HttpError({ statusCode: 400, message: ErrorCode.BookingTimeOutOfBounds });
};