Use warning log level for skipped entities
This commit is contained in:
parent
29036deb58
commit
4fb240b39a
@ -161,7 +161,7 @@ export async function handle(rcMessage: RcMessage): Promise<void> {
|
||||
case 'added-user-to-team': // Added user to team
|
||||
case 'r': // Room name changed
|
||||
case 'rm': // Message removed
|
||||
log.info(
|
||||
log.warn(
|
||||
`Message ${rcMessage._id} is of type ${rcMessage.t}, for which Rocket.Chat does not provide the initial state information, skipping.`
|
||||
)
|
||||
return
|
||||
|
||||
@ -106,7 +106,9 @@ test('mapping private rooms', () => {
|
||||
test('mapping live chats', () => {
|
||||
expect(() =>
|
||||
mapRoom({ _id: 'liveChatId', t: RcRoomTypes.live })
|
||||
).toThrowError('Room type l is unknown')
|
||||
).toThrowError(
|
||||
'Room with ID: liveChatId is a live chat. Migration not implemented'
|
||||
)
|
||||
})
|
||||
|
||||
test('getting creator', () => {
|
||||
|
||||
@ -83,10 +83,18 @@ export function mapRoom(rcRoom: RcRoom): MatrixRoom {
|
||||
break
|
||||
|
||||
case RcRoomTypes.live:
|
||||
const messageLivechat = `Room ${
|
||||
rcRoom.name || 'with ID: ' + rcRoom._id
|
||||
} is a live chat. Migration not implemented`
|
||||
log.warn(messageLivechat)
|
||||
throw new Error(messageLivechat)
|
||||
|
||||
default:
|
||||
const message = `Room type ${rcRoom.t} is unknown or unimplemented`
|
||||
log.error(message)
|
||||
throw new Error(message)
|
||||
const messageUnknownRoom = `Room ${
|
||||
rcRoom.name || 'with ID: ' + rcRoom._id
|
||||
} is of type ${rcRoom.t}, which is unknown or unimplemented`
|
||||
log.error(messageUnknownRoom)
|
||||
throw new Error(messageUnknownRoom)
|
||||
}
|
||||
return room
|
||||
}
|
||||
@ -98,7 +106,7 @@ export function getCreator(rcRoom: RcRoom): string {
|
||||
return rcRoom.uids[0]
|
||||
} else {
|
||||
log.warn(
|
||||
`Creator ID could not be determined for room ${rcRoom.name} of type ${rcRoom.t}. This is normal for the default room.`
|
||||
`Creator ID could not be determined for room ${rcRoom.name} of type ${rcRoom.t}. This is normal for the default room. Using admin user.`
|
||||
)
|
||||
return ''
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user