code: func NewError(err error, code string, metadata ...map[string]string) *Error {
  	if pitayaErr, ok := err.(*Error); ok {
  		if len(metadata) > 0 {
  			mergeMetadatas(pitayaErr, metadata[0])
  		}
  		return pitayaErr
  	}
  
  	e := &Error{
  		Code:    code,
  		Message: err.Error(),
  	}
  	if len(metadata) > 0 {
  		e.Metadata = metadata[0]
  	}
  	return e
  
  }
docs: //NewError ctor