3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 06:19:24 +01:00

Minify module

basic framework for more human-readable error responses from the bitly minifier
This commit is contained in:
Scritches 2018-03-26 16:23:03 -04:00
parent 19cc4c474d
commit 43cfe3b637

View File

@ -26,7 +26,14 @@ var minify = function(dbot) {
if (body.status_code == 200) {
callback(body.data.url);
} else {
callback(false, body.status_txt);
var emsg = function() {
switch(body.status_txt) {
case "INVALID_URI": return "Invalid URL was supplied";
default: return body.status_txt;
}
}
callback(false, emsg);
}
} else {
callback(false, error);