kaori před 4 roky
rodič
revize
748d26ac59
1 změnil soubory, kde provedl 15 přidání a 1 odebrání
  1. 15 1
      packages/slackbot-proxy/src/controllers/slack.ts

+ 15 - 1
packages/slackbot-proxy/src/controllers/slack.ts

@@ -105,7 +105,21 @@ export class SlackCtrl {
       return 'No text.';
     }
 
-    const growiCommand = parseSlashCommand(body);
+    let growiCommand;
+
+    try {
+      growiCommand = parseSlashCommand(body);
+    }
+    catch (e) {
+      console.log('errorでたaaa');
+      res.json({
+        blocks: [
+          markdownSectionBlock('*No relation found.*'),
+          markdownSectionBlock('Run `/growi register` first.'),
+        ],
+      });
+      // res.send();
+    }
 
     // register
     if (growiCommand.growiCommandType === 'register') {