diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2022-10-28 16:24:35 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2022-11-08 12:33:03 +0300 |
commit | 26b6a88891295615bdcf61b09aa862937c3b9c00 (patch) | |
tree | 9e7fedfd2b2bab4017269c49092f9d28462c634a | |
parent | 36340fafd9bca73c188afa1cafce9efd232afba5 (diff) |
internal/errors: New shared validation errors
The new validation errors now added to the shared 'errors' package.
The main idea is to re-use these in the services instead of
creating a new error in place. The 'ErrEmptyStorageName' error
signals that the repository doesn't have 'StorageName' field set to
non-blank value. The 'ErrEmptyRelativePath' does the same, but only
for the 'RelativePath' field.
Part of https://gitlab.com/gitlab-org/gitaly/-/issues/3717
-rw-r--r-- | internal/errors/errors.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/errors/errors.go b/internal/errors/errors.go index d2efaef52..b45d78a7c 100644 --- a/internal/errors/errors.go +++ b/internal/errors/errors.go @@ -5,6 +5,10 @@ import "errors" var ( // ErrEmptyRepository is returned when an RPC is missing a repository as an argument ErrEmptyRepository = errors.New("empty Repository") + // ErrEmptyStorageName is returned when an RPC is missing a storage name for the repository. + ErrEmptyStorageName = errors.New("empty StorageName") + // ErrEmptyRelativePath is returned when an RPC is missing a relative path for the repository. + ErrEmptyRelativePath = errors.New("empty RelativePath") // ErrInvalidRepository is returned when an RPC has an invalid repository as an argument ErrInvalidRepository = errors.New("invalid Repository") ) |