aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-16 07:14:27 +0800
committerobscuren <geffobscura@gmail.com>2015-04-16 07:28:24 +0800
commit3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a (patch)
treeb2d4a5e7fcc1da2fd5b1aa3c139ddc7594c8646c /common
parent97d2954e227049a089652d91e6fb0ea1c8115cc6 (diff)
parentc4678ffd77a18a9d03c888fdf242c9e5915b9f5f (diff)
downloaddexon-3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a.tar
dexon-3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a.tar.gz
dexon-3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a.tar.bz2
dexon-3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a.tar.lz
dexon-3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a.tar.xz
dexon-3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a.tar.zst
dexon-3a51c3b584b16b408c3fbf87c4f9719fcfb1c52a.zip
Merge branch 'develop' into downloader-proto
Diffstat (limited to 'common')
-rw-r--r--common/debug.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/debug.go b/common/debug.go
new file mode 100644
index 000000000..69675cc6c
--- /dev/null
+++ b/common/debug.go
@@ -0,0 +1,20 @@
+package common
+
+import (
+ "fmt"
+ "os"
+ "runtime"
+ "runtime/debug"
+)
+
+func Report(extra ...interface{}) {
+ fmt.Fprintln(os.Stderr, "You've encountered a sought after, hard to reproduce bug. Please report this to the developers <3 https://github.com/ethereum/go-ethereum/issues")
+ fmt.Fprintln(os.Stderr, extra...)
+
+ _, file, line, _ := runtime.Caller(1)
+ fmt.Fprintf(os.Stderr, "%v:%v\n", file, line)
+
+ debug.PrintStack()
+
+ fmt.Fprintln(os.Stderr, "#### BUG! PLEASE REPORT ####")
+}