mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-04-04 15:58:49 +02:00
Signed-off-by: reggie-k <regina.voloshin@codefresh.io> Signed-off-by: Regina Voloshin <regina.voloshin@codefresh.io> Co-authored-by: Nitish Kumar <justnitish06@gmail.com> Co-authored-by: dudinea <dudinea@gmail.com>
24 lines
676 B
Go
24 lines
676 B
Go
package pull_request
|
|
|
|
import "errors"
|
|
|
|
// RepositoryNotFoundError represents an error when a repository is not found by a pull request provider
|
|
type RepositoryNotFoundError struct {
|
|
causingError error
|
|
}
|
|
|
|
func (e *RepositoryNotFoundError) Error() string {
|
|
return e.causingError.Error()
|
|
}
|
|
|
|
// NewRepositoryNotFoundError creates a new repository not found error
|
|
func NewRepositoryNotFoundError(err error) error {
|
|
return &RepositoryNotFoundError{causingError: err}
|
|
}
|
|
|
|
// IsRepositoryNotFoundError checks if the given error is a repository not found error
|
|
func IsRepositoryNotFoundError(err error) bool {
|
|
var repoErr *RepositoryNotFoundError
|
|
return errors.As(err, &repoErr)
|
|
}
|