Add ignore other event types and more error logging

This commit is contained in:
Henrik Hüttemann
2023-08-31 18:59:53 +02:00
parent d711b81f23
commit b5605e64f7
2 changed files with 16 additions and 3 deletions
+8 -1
View File
@@ -9,6 +9,7 @@ import log from './helpers/logger'
import { initStorage } from './helpers/storage'
import { whoami } from './helpers/synapse'
import { Entity, entities } from './Entities'
import { AxiosError } from 'axios'
log.info('rocketchat2matrix starts.')
@@ -49,7 +50,13 @@ async function main() {
await loadRcExport(Entity.Messages)
log.info('Done.')
} catch (error) {
log.error(`Encountered an error while booting up: ${error}`, error)
if (error instanceof AxiosError) {
log.error(`Error during request: ${error.message}`)
log.error(`Request: ${error.request?.method} ${error.request?.path}`)
log.error(`Response: ${error.response?.status}`, error.response?.data)
} else {
log.error(`Encountered an error while booting up: ${error}`, error)
}
}
}