add GetError method to Error type
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
3e1ffcb989
commit
5c829fe029
@ -13,6 +13,14 @@ func SetError(err interface{}) error {
|
|||||||
return &Error{err: err}
|
return &Error{err: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetError return underline error
|
||||||
|
func GetError(err interface{}) interface{} {
|
||||||
|
if verr, ok := err.(*Error); ok {
|
||||||
|
return verr.err
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Error struct holds error
|
// Error struct holds error
|
||||||
type Error struct {
|
type Error struct {
|
||||||
err interface{}
|
err interface{}
|
||||||
|
Loading…
Reference in New Issue
Block a user