Browse files

Call toString on Error objects when logging to console.

  • Loading branch information...
1 parent 2585b16 commit 53d7664d97a85390620dee9eb672b985310cea08 @tedtate tedtate committed Mar 4, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 api/logging.js
View
3 api/logging.js
@@ -23,8 +23,11 @@
if (obj) {
$.each(obj, function(key, value) {
noneWritten && console.group(title);
+
if (typeof key == "number") {
console[fn].apply(window, value);
+ } else if (value instanceof Error) {
+ console.error(key, value.toString());
} else {
console[fn](key, value);
}

0 comments on commit 53d7664

Please sign in to comment.