Skip to content
This repository
  • 2 commits
  • 1 file changed
  • 0 comments
  • 2 contributors
Mar 04, 2013
Ted Tate tedtate Call toString on Error objects when logging to console. 53d7664
Mar 06, 2013
John Boxall johnboxall Merge pull request #109 from mobify/error-logging
Call toString on Error objects when logging to console.
b995560

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. +3 0  api/logging.js
3  api/logging.js
@@ -23,8 +23,11 @@
23 23 if (obj) {
24 24 $.each(obj, function(key, value) {
25 25 noneWritten && console.group(title);
  26 +
26 27 if (typeof key == "number") {
27 28 console[fn].apply(window, value);
  29 + } else if (value instanceof Error) {
  30 + console.error(key, value.toString());
28 31 } else {
29 32 console[fn](key, value);
30 33 }

No commit comments for this range

Something went wrong with that request. Please try again.