Skip to content

Commit

Permalink
Special handling for Error instances
Browse files Browse the repository at this point in the history
  • Loading branch information
tikonen committed Mar 26, 2012
1 parent 6c3d671 commit 83ff76f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/sprintf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 83ff76f

Please sign in to comment.