diff --git a/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts b/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts index 5b05f8cb7..e67dfe192 100644 --- a/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts +++ b/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts @@ -397,12 +397,12 @@ export class Rocketchat implements INodeType { async executeSingle(this: IExecuteSingleFunctions): Promise { const resource = this.getNodeParameter('resource') as string; - const opeation = this.getNodeParameter('operation') as string; + const operation = this.getNodeParameter('operation') as string; let response; if (resource === 'chat') { //https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage - if (opeation === 'postMessage') { + if (operation === 'postMessage') { const channel = this.getNodeParameter('channel') as string; const text = this.getNodeParameter('text') as string; const options = this.getNodeParameter('options') as IDataObject; @@ -489,11 +489,7 @@ export class Rocketchat implements INodeType { body.attachments = validateJSON(this.getNodeParameter('attachmentsJson') as string); } - try { - response = await rocketchatApiRequest.call(this, '/chat', 'POST', 'postMessage', body); - } catch (err) { - throw new Error(`Rocketchat Error: ${err}`); - } + response = await rocketchatApiRequest.call(this, '/chat', 'POST', 'postMessage', body); } }