github.com/Ali-iotechsys/sqlboiler/v4@v4.0.0-20221208124957-6aec9a5f1f71/boil/errors.go (about)

     1  package boil
     2  
     3  type boilErr struct {
     4  	error
     5  }
     6  
     7  // WrapErr wraps err in a boilErr
     8  func WrapErr(err error) error {
     9  	return boilErr{
    10  		error: err,
    11  	}
    12  }
    13  
    14  // Error returns the underlying error string
    15  func (e boilErr) Error() string {
    16  	return e.error.Error()
    17  }
    18  
    19  // IsBoilErr checks if err is a boilErr
    20  func IsBoilErr(err error) bool {
    21  	_, ok := err.(boilErr)
    22  	return ok
    23  }