error.go 487 B

12345678910111213141516171819202122
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package git
  5. import (
  6. "fmt"
  7. )
  8. type ErrUnsupportedVersion struct {
  9. Required string
  10. }
  11. func IsErrUnsupportedVersion(err error) bool {
  12. _, ok := err.(ErrUnsupportedVersion)
  13. return ok
  14. }
  15. func (err ErrUnsupportedVersion) Error() string {
  16. return fmt.Sprintf("Operation requires higher version [required: %s]", err.Required)
  17. }