Return bad request if hook already installed
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
dbd41f518d
commit
6051fa016c
2 changed files with 2 additions and 2 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue