Permalink
Browse files

Merge pull request #9 from tikonen/master

Special handling for printing out Error object
  • Loading branch information...
maritz committed Nov 7, 2012
2 parents cb5e921 + 83ff76f commit 53cdb21004c9fc2527d50445ace1582abac7efb1
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/sprintf.js
View
@@ -98,6 +98,7 @@ var sprintf = (function() {
return '[Function' + (obj.name ? ': '+obj.name : '') + ']';
break;
case 'object':
+ if ( obj instanceof Error) { return '[' + obj.toString() + ']' };
if (depth >= maxdepth) return '[Object]'
if (seen) {
// add object to seen list

0 comments on commit 53cdb21

Please sign in to comment.