forked from GitHub/dbot
Minify module
basic framework for more human-readable error responses from the bitly minifier
This commit is contained in:
parent
19cc4c474d
commit
43cfe3b637
@ -26,7 +26,14 @@ var minify = function(dbot) {
|
|||||||
if (body.status_code == 200) {
|
if (body.status_code == 200) {
|
||||||
callback(body.data.url);
|
callback(body.data.url);
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
callback(false, error);
|
callback(false, error);
|
||||||
|
Loading…
Reference in New Issue
Block a user