You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.go 587B

12345678910111213141516171819202122232425
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package migration
  4. import "fmt"
  5. // ErrNotSupported represents status if a downloader do not supported something.
  6. type ErrNotSupported struct {
  7. Entity string
  8. }
  9. // IsErrNotSupported checks if an error is an ErrNotSupported
  10. func IsErrNotSupported(err error) bool {
  11. _, ok := err.(ErrNotSupported)
  12. return ok
  13. }
  14. // Error return error message
  15. func (err ErrNotSupported) Error() string {
  16. if len(err.Entity) != 0 {
  17. return fmt.Sprintf("'%s' not supported", err.Entity)
  18. }
  19. return "not supported"
  20. }