Permalink
Browse files

Log error string of failed lfapi queries

  • Loading branch information...
1 parent 1fd3646 commit 5aaf7038fef5897a5142737f4fef7f4c81f6ef1b @theMarix theMarix committed Apr 14, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lfcli.js
View
4 lfcli.js
@@ -74,7 +74,7 @@ exports.query = function(path, args, handler) {
// TODO handle parsing errors
var answer = JSON.parse(body);
if(!answer.status || answer.status !== 'ok') {
- console.warn('STATUS: ' + answer.status + ' - Query was: ' + path + ' ' + JSON.stringify(args));
+ console.warn('STATUS: ' + answer.status + ' - Error String: "' + answer.error + '" - Query was: ' + path + ' ' + JSON.stringify(args));
}
// TODO different handler in case of errors
handler(answer);
@@ -118,7 +118,7 @@ exports.perform = function(path, args, handler) {
// TODO handle parsing errors
var answer = JSON.parse(body);
if(!answer.status || answer.status !== 'ok') {
- console.warn('STATUS: ' + answer.status + ' - Query was: ' + path + ' ' + JSON.stringify(args));
+ console.warn('STATUS: ' + answer.status + ' - Error String: "' + answer.error + '" - Query was: ' + path + ' ' + JSON.stringify(args));
}
// TODO different handler in case of errors
handler(answer);

0 comments on commit 5aaf703

Please sign in to comment.