feature_errors.go 1.4 KB

12345678910111213141516171819202122232425
  1. package errors
  2. import (
  3. "context"
  4. )
  5. // PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature.
  6. // Do not remove this function even there is no reference to it.
  7. func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) {
  8. if len(migrateFeature) > 0 {
  9. LogWarning(context.Background(), "This feature " + feature + " is deprecated and being migrated to " + migrateFeature + ". Please update your config(s) according to release note and documentation before removal.")
  10. } else {
  11. LogWarning(context.Background(), "This feature " + feature + " is deprecated. Please update your config(s) according to release note and documentation before removal.")
  12. }
  13. }
  14. // PrintRemovedFeatureError prints an error message for removed feature then return an error. And after long enough time the message can also be removed, uses as an indicator.
  15. // Do not remove this function even there is no reference to it.
  16. func PrintRemovedFeatureError(feature string, migrateFeature string) (error) {
  17. if len(migrateFeature) > 0 {
  18. return New("The feature " + feature + " has been removed and migrated to " + migrateFeature + ". Please update your config(s) according to release note and documentation.")
  19. } else {
  20. return New("The feature " + feature + " has been removed. Please update your config(s) according to release note and documentation.")
  21. }
  22. }