code: func ToError(err error) *Error {
  	if err == nil {
  		return nil
  	}
  
  	if err, ok := err.(rpc.Error); ok {
  		return &Error{Code: err.ErrorCode(), Message: err.Error()}
  	}
  
  	return &Error{Message: err.Error()}
  }
docs: // ToError converts error into Error pointer.