Skip to content

Commit

Permalink
Errors raised during reservation now have a 'reservation' attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krienbühl committed Apr 27, 2016
1 parent 3b33cce commit a36cad3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
---------

- Errors raised during reservation now have a 'reservation' attribute.
[href]

0.2.0 (2016-04-26)
~~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 7 additions & 4 deletions libres/db/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,13 @@ def approve_reservations(self, token):
assert reservation.session_id is None, """
Reservations must be confirmed before they can be approved.
"""

slots_to_reserve.extend(
self._approve_reservation_record(reservation)
)
try:
slots_to_reserve.extend(
self._approve_reservation_record(reservation)
)
except errors.LibresError as e:
e.reservation = reservation
raise e

events.on_reservations_approved(self.context, reservations)

Expand Down

0 comments on commit a36cad3

Please sign in to comment.