Skip to content

Commit

Permalink
backend: Improved logs
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Jul 11, 2024
1 parent f11dc63 commit 8cc724d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions openvidu-call-back/src/controllers/webhook.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export const webhookHandler = async (req: Request, res: Response) => {
isRoomCreatedByMe = roomOrRoomName ? await roomService.isRoomCreatedByMe(roomOrRoomName) : false;
}

// Skip webhook events that are not related to OpenVidu Call only if there is a room or room name
// and the room was not created by me
// Skip webhook events that are not related to OpenVidu Call
if (roomOrRoomName && !isRoomCreatedByMe) {
logger.verbose(`Skipping webhook, event is not related to OpenVidu Call: ${eventType}`);
return res.status(200).send();
Expand Down
4 changes: 2 additions & 2 deletions openvidu-call-back/src/models/error.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const errorRecordingAlreadyStarted = (roomName: string): OpenViduCallErro
// Broadcasting errors

export const errorSessionWithoutParticipants = (roomName: string): OpenViduCallError => {
return new OpenViduCallError('Broadcasting Error', `The room '${roomName}' do not have participants`, 406);
return new OpenViduCallError('Broadcasting Error', `The room '${roomName}' does not have participants`, 406);
};

export const errorBroadcastingAlreadyStarted = (roomName: string): OpenViduCallError => {
Expand All @@ -70,7 +70,7 @@ export const errorBroadcastingNotStarted = (roomName: string): OpenViduCallError

// Room errors
export const errorRoomNotFound = (roomName: string): OpenViduCallError => {
return new OpenViduCallError('Room Error', `The room '${roomName}' do not exist`, 404);
return new OpenViduCallError('Room Error', `The room '${roomName}' does not exist`, 404);
};

export const errorParticipantAlreadyExists = (participantName: string, roomName: string): OpenViduCallError => {
Expand Down
2 changes: 1 addition & 1 deletion openvidu-call-back/src/services/room.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class RoomService {
const metadata = room.metadata ? JSON.parse(room.metadata) : null;
return metadata?.createdBy === CALL_NAME_ID;
} catch (error) {
console.warn('Error getting Room while parsing webhook checking if isRoomCreatedByMe:', error);
console.warn('Error getting Room while checking webhook. Room may no longer exist. Ignoring');
return false;
}
}
Expand Down

0 comments on commit 8cc724d

Please sign in to comment.