Browse Source

Make the code of error message more specific

Signed-off-by: Vitor Mattos <vitor@php.rio>
pull/8446/head
Vitor Mattos 3 years ago
parent
commit
c2a55aac36
No known key found for this signature in database GPG Key ID: B7AB4B76A7CA7318
  1. 4
      docs/recording.md
  2. 4
      lib/Service/RoomService.php

4
docs/recording.md

@ -18,7 +18,7 @@
+ `200 OK`
+ `400 Bad Request` Message: `status`. When the status to start is invalid.
+ `400 Bad Request` Message: `config`. Need to enable the config `recording`.
+ `400 Bad Request` Message: `room`. Already have a recording in progress.
+ `400 Bad Request` Message: `recording`. Already have a recording in progress.
+ `400 Bad Request` Message: `call`. Call is not activated.
+ `403 Forbidden` When the user is not a moderator/owner.
+ `412 Precondition Failed` When the lobby is active and the user is not a moderator.
@ -33,7 +33,7 @@
- Status code:
+ `200 OK`
+ `400 Bad Request` Message: `config`. Need to enable the config `recording`.
+ `400 Bad Request` Message: `room`. Recording has already been stopped.
+ `400 Bad Request` Message: `recording`. Recording has already been stopped.
+ `400 Bad Request` Message: `call`. Call is not activated.
+ `403 Forbidden` When the user is not a moderator/owner.
+ `412 Precondition Failed` When the lobby is active and the user is not a moderator.

4
lib/Service/RoomService.php

@ -372,7 +372,7 @@ class RoomService {
throw new InvalidArgumentException('status');
}
if ($room->getCallRecording() !== Room::RECORDING_NONE) {
throw new InvalidArgumentException('room');
throw new InvalidArgumentException('recording');
}
if (!$room->getActiveSince() instanceof \DateTimeInterface) {
throw new InvalidArgumentException('call');
@ -382,7 +382,7 @@ class RoomService {
public function stopRecording(Room $room): bool {
if ($room->getCallRecording() === Room::RECORDING_NONE) {
throw new InvalidArgumentException('room');
throw new InvalidArgumentException('recording');
}
return $this->setCallRecording($room);
}

Loading…
Cancel
Save