Skip to content

Protect against getting a non-error while importing a message

Eric Eastwood requested to merge protect-against-non-error into develop

Protect against getting a non-error like when matrix-appservice-bridge/matrix-bot-sdk gives a request looking object whiling importing from Gitter -> Matrix

Example failure:

MatrixHttpClient (REQ-6) { errcode: 'M_UNKNOWN', error: 'Displayname is too long (max 256)' }
(node:23253) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
    at new RethrownError (./modules/matrix-bridge/lib/rethrown-error.js:46:8)
    at ./modules/matrix-bridge/lib/gitter-to-matrix-historical-import.js:405:18
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:23253) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23253) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C2023-01-31T03:42:13.971Z - warn: Waiting for this ongoing message send request to finish and bridged information stored...

Follow-up to !2313 (merged)

Part of #2609 (closed)

Edited by Eric Eastwood

Merge request reports