Changing debug message style,

See #24, for !tootunlocks
pull/25/head
Stephen Vanderwarker 7 months ago
parent 6f2e29c95e
commit 2f4f1fc400

@ -130,10 +130,9 @@ try {
// check for debugging
function debug() {
if (debugging === '1') {
console.log('-------------');
console.log('[DEBUG]');
console.log(message);
console.log(from);
console.log('-------------');
};
}
function resError(error,res){
@ -221,18 +220,7 @@ try {
});
debug();
}
if (!error && res.statusCode == 401) {
console.log('Invalid credentials');
xmpp.send(from, 'Invalid credentials');
}
if (!error && res.statusCode == 404) {
console.log('Record not found');
xmpp.send(from, 'Record not found');
}
if (!error && res.statusCode == 500) {
console.log('Server error.');
xmpp.send(from, 'Server error. Please ping admin');
}
resError(error,res);
});
debug();
}
@ -335,7 +323,6 @@ try {
if (!error && res.statusCode == 200) {
xmpp.send(from, tuya_name + " set to " + per + "%");
console.log(tuya_name + " set to " + per + "%");
}
resError(error,res);
});