github.com/covergates/covergates@v0.2.2-0.20201009050117-42ef8a19fb95/models/error.go (about)

     1  package models
     2  
     3  import (
     4  	"errors"
     5  	"fmt"
     6  
     7  	"github.com/covergates/covergates/core"
     8  )
     9  
    10  var errUserExist = errors.New("user already exist")
    11  
    12  type errNotSupportedSCM struct {
    13  	scm core.SCMProvider
    14  }
    15  
    16  func (e *errNotSupportedSCM) Error() string {
    17  	return fmt.Sprintf("%s is not supported", string(e.scm))
    18  }
    19  
    20  // IsErrNotSupportedSCM check
    21  func IsErrNotSupportedSCM(err error) bool {
    22  	_, ok := err.(*errNotSupportedSCM)
    23  	return ok
    24  }