From 9d73e017442367e93b38d91e25acb9a1ce8b3447 Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Sat, 1 Apr 2017 22:08:09 -0700
Subject: [PATCH] Improve errors

---
 index.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 06134c8..d73db60 100644
--- a/index.js
+++ b/index.js
@@ -28,7 +28,12 @@ app.get( '/', function( req, res ) {
 app.post( '/log', function( req, res ) {
 	// Don't bother if there's nothing to record
 	if ( 'undefined' === typeof req.body || 'undefined' === typeof req.body.text || ! req.body.text.length ) {
-		return res.sendStatus( 400 );
+		var response = {
+			"response_type": "ephemeral",
+			"text": "Please provide something to record."
+		};
+
+		return res.status( 400 ).send( response );
 	}
 
 	// Limit who can trigger the command
@@ -38,7 +43,7 @@ app.post( '/log', function( req, res ) {
 			"text": "Sorry, you can't record completed tasks."
 		};
 
-		return res.send( response );
+		return res.status( 403 ).send( response );
 	}
 
 	// Massage the title
-- 
GitLab