Return bad request if hook already installed

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-08-15 21:26:31 +00:00
parent dbd41f518d
commit 6051fa016c
No known key found for this signature in database
GPG key ID: 7D073DCC2C074CB5
2 changed files with 2 additions and 2 deletions

View file

@ -273,7 +273,7 @@ func (r *organization) InstallHook(ctx context.Context, req *github.Hook) error
for _, hook := range allHooks {
if hook.Config["url"] == req.Config["url"] {
return fmt.Errorf("hook already installed: %w", runnerErrors.ErrBadRequest)
return runnerErrors.NewBadRequestError("hook already installed")
}
}

View file

@ -274,7 +274,7 @@ func (r *repository) InstallHook(ctx context.Context, req *github.Hook) error {
for _, hook := range allHooks {
if hook.Config["url"] == req.Config["url"] {
return fmt.Errorf("hook already installed: %w", runnerErrors.ErrBadRequest)
return runnerErrors.NewBadRequestError("hook already installed")
}
}