aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-07 19:10:21 +0800
committerobscuren <geffobscura@gmail.com>2015-04-07 19:10:21 +0800
commitc756633fb7f39caa4f0e28aab58c7393c8dae9b1 (patch)
treeb388003c3c275b17e65835bcb598594d63d48c3a
parent43454053b0d72a0747f4a86ceabf9d5895d3032b (diff)
parent7c583f82228fb373dd6bbe15effb68cf5aac0ad9 (diff)
downloaddexon-c756633fb7f39caa4f0e28aab58c7393c8dae9b1.tar
dexon-c756633fb7f39caa4f0e28aab58c7393c8dae9b1.tar.gz
dexon-c756633fb7f39caa4f0e28aab58c7393c8dae9b1.tar.bz2
dexon-c756633fb7f39caa4f0e28aab58c7393c8dae9b1.tar.lz
dexon-c756633fb7f39caa4f0e28aab58c7393c8dae9b1.tar.xz
dexon-c756633fb7f39caa4f0e28aab58c7393c8dae9b1.tar.zst
dexon-c756633fb7f39caa4f0e28aab58c7393c8dae9b1.zip
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
-rw-r--r--jsre/pp_js.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/jsre/pp_js.go b/jsre/pp_js.go
index 2badb90e7..5c09b2586 100644
--- a/jsre/pp_js.go
+++ b/jsre/pp_js.go
@@ -2,17 +2,13 @@ package jsre
const pp_js = `
function pp(object, indent) {
- var str = "";
- /*
- var o = object;
try {
- object = JSON.stringify(object)
- object = JSON.parse(object);
- } catch(e) {
- object = o;
- }
- */
+ JSON.stringify(object)
+ } catch(e) {
+ return pp(e, indent);
+ }
+ var str = "";
if(object instanceof Array) {
str += "[";
for(var i = 0, l = object.length; i < l; i++) {
@@ -24,7 +20,7 @@ function pp(object, indent) {
}
str += " ]";
} else if (object instanceof Error) {
- str += "\033[31m" + "Error";
+ str += "\033[31m" + "Error:\033[0m " + object.message;
} else if (isBigNumber(object)) {
str += "\033[32m'" + object.toString(10) + "'";
} else if(typeof(object) === "object") {