wip
This commit is contained in:
@@ -271,13 +271,8 @@ class RoomViewSet(
|
||||
status=drf_status.HTTP_200_OK,
|
||||
)
|
||||
|
||||
try:
|
||||
self.session_manager.start_recording(recording)
|
||||
except RecordingStartError:
|
||||
return drf_response.Response(
|
||||
{"message": f"Failed to start recording for room {room.slug}."},
|
||||
status=drf_status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
)
|
||||
# May raise exception
|
||||
self.session_manager.start_recording(recording)
|
||||
|
||||
return drf_response.Response(
|
||||
{"message": f"Recording started for room {room.slug}"},
|
||||
@@ -307,13 +302,8 @@ class RoomViewSet(
|
||||
status=drf_status.HTTP_404_NOT_FOUND,
|
||||
)
|
||||
|
||||
try:
|
||||
self.session_manager.stop_recording(recording)
|
||||
except RecordingStopError:
|
||||
return drf_response.Response(
|
||||
{"message": f"Failed to stop recording for room {room.slug}."},
|
||||
status=drf_status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
)
|
||||
# May raise exception
|
||||
self.session_manager.stop_recording(recording)
|
||||
|
||||
return drf_response.Response(
|
||||
{"message": f"Recording stopped for room {room.slug}."}
|
||||
|
||||
@@ -82,7 +82,7 @@ class StorageHandler:
|
||||
|
||||
# todo - check others status
|
||||
if RecordingStatusChoices.is_error_status(recording.status):
|
||||
logger.error(
|
||||
logger.exception(
|
||||
"Recording with ID %s is in an error state and cannot be saved.",
|
||||
recording.id,
|
||||
)
|
||||
@@ -91,7 +91,7 @@ class StorageHandler:
|
||||
)
|
||||
|
||||
if recording.status == RecordingStatusChoices.SAVED:
|
||||
logger.error("Recording with ID %s is already saved.", recording.id)
|
||||
logger.exception("Recording with ID %s is already saved.", recording.id)
|
||||
raise RecordingUpdateError(
|
||||
f"Recording with ID {recording.id} is already saved."
|
||||
)
|
||||
@@ -121,12 +121,12 @@ class StorageHandler:
|
||||
try:
|
||||
recording_id = self._parser.extract_recording_id(data)
|
||||
except InvalidRequestDataError as e:
|
||||
logger.error("Could not handle hook event %s", e)
|
||||
logger.exception("Could not handle hook event %s", e)
|
||||
logger.debug("Invalid request data: %s", data)
|
||||
raise IgnoreNotificationError("Invalid request data received.") from e
|
||||
|
||||
except InvalidBucketError as e:
|
||||
logger.error("Invalid bucket queried: %s", e)
|
||||
logger.exception("Invalid bucket queried: %s", e)
|
||||
raise IgnoreNotificationError("Invalid bucket specified.") from e
|
||||
|
||||
except InvalidFileTypeError as e:
|
||||
@@ -137,7 +137,7 @@ class StorageHandler:
|
||||
try:
|
||||
recording = Recording.objects.get(recording_id)
|
||||
except Recording.DoesNotExist as e:
|
||||
logger.error("Recording with ID %s not found.", recording_id)
|
||||
logger.exception("Recording with ID %s not found.", recording_id)
|
||||
raise RecordingNotFound(
|
||||
f"Recording with ID {recording_id} not found."
|
||||
) from e
|
||||
|
||||
Reference in New Issue
Block a user