aboutsummaryrefslogtreecommitdiffstats
path: root/core/error.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-10 00:55:01 +0800
committerobscuren <geffobscura@gmail.com>2015-03-10 00:55:01 +0800
commit8560004f380dc688a1171ad5aeffa593aae41193 (patch)
treefea395acf042b51e97a86e2c4cbcf8c16b2912b7 /core/error.go
parent9723191b19f6ddc12f0c3376ede7529b2d72e6a2 (diff)
parent676a0de58d3d7c508b0eeeff192d2095a46f7382 (diff)
downloaddexon-8560004f380dc688a1171ad5aeffa593aae41193.tar
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.gz
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.bz2
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.lz
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.xz
dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.zst
dexon-8560004f380dc688a1171ad5aeffa593aae41193.zip
wip
Diffstat (limited to 'core/error.go')
-rw-r--r--core/error.go36
1 files changed, 35 insertions, 1 deletions
diff --git a/core/error.go b/core/error.go
index e86bacb2d..04e40646c 100644
--- a/core/error.go
+++ b/core/error.go
@@ -22,7 +22,7 @@ func (err *ParentErr) Error() string {
}
func ParentError(hash []byte) error {
- return &ParentErr{Message: fmt.Sprintf("Block's parent unkown %x", hash)}
+ return &ParentErr{Message: fmt.Sprintf("Block's parent unknown %x", hash)}
}
func IsParentErr(err error) bool {
@@ -87,6 +87,24 @@ func IsNonceErr(err error) bool {
return ok
}
+type InvalidTxErr struct {
+ Message string
+}
+
+func (err *InvalidTxErr) Error() string {
+ return err.Message
+}
+
+func InvalidTxError(err error) *InvalidTxErr {
+ return &InvalidTxErr{fmt.Sprintf("%v", err)}
+}
+
+func IsInvalidTxErr(err error) bool {
+ _, ok := err.(*InvalidTxErr)
+
+ return ok
+}
+
type OutOfGasErr struct {
Message string
}
@@ -128,3 +146,19 @@ func IsKnownBlockErr(e error) bool {
_, ok := e.(*KnownBlockError)
return ok
}
+
+type ValueTransferError struct {
+ message string
+}
+
+func ValueTransferErr(str string, v ...interface{}) *ValueTransferError {
+ return &ValueTransferError{fmt.Sprintf(str, v...)}
+}
+
+func (self *ValueTransferError) Error() string {
+ return self.message
+}
+func IsValueTransferErr(e error) bool {
+ _, ok := e.(*ValueTransferError)
+ return ok
+}