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
No known key found for this signature in database
GPG Key ID: B7AB4B76A7CA7318
2 changed files with
4 additions and
4 deletions
-
docs/recording.md
-
lib/Service/RoomService.php
|
|
|
@ -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. |
|
|
|
@ -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); |
|
|
|
} |
|
|
|
|