From eea5f3775f9c8c986d0c9f5e062188f89f5274cc Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 8 May 2020 14:46:38 +0200 Subject: [PATCH] :zap: Fix typo --- .../nodes-base/nodes/Rocketchat/Rocketchat.node.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts b/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts index 5b05f8cb70..e67dfe192c 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); } }