code: func CodeFromError(err error) string {
  	if err == nil {
  		return ""
  	}
  
  	pitayaErr, ok := err.(*Error)
  	if !ok {
  		return ErrUnknownCode
  	}
  
  	if pitayaErr == nil {
  		return ""
  	}
  
  	return pitayaErr.Code
  }
docs: // CodeFromError returns the code of error.
  // If error is nil, return empty string.
  // If error is not a pitaya error, returns unkown code