-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify EncryptedRPC Client (#1877)
* encr client * cleanup * fix error bubbling
- Loading branch information
1 parent
261253b
commit 4e6e239
Showing
17 changed files
with
139 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package errutil | ||
|
||
// EVMSerialisableError is an API error that encompasses an EVM error with a code and a reason | ||
type EVMSerialisableError struct { | ||
Err string | ||
Reason interface{} | ||
Code int | ||
// DataError is an API error that encompasses an EVM error with a code and a reason | ||
type DataError struct { | ||
Code int `json:"code"` | ||
Err string `json:"message"` | ||
Reason interface{} `json:"data,omitempty"` | ||
} | ||
|
||
func (e EVMSerialisableError) Error() string { | ||
func (e DataError) Error() string { | ||
return e.Err | ||
} | ||
|
||
func (e EVMSerialisableError) ErrorCode() int { | ||
func (e DataError) ErrorCode() int { | ||
return e.Code | ||
} | ||
|
||
func (e EVMSerialisableError) ErrorData() interface{} { | ||
func (e DataError) ErrorData() interface{} { | ||
return e.Reason | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.