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:
parent
19cc4c474d
commit
43cfe3b637
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user