diff options
Diffstat (limited to 'internal/api/client/admin/ruleget.go')
-rw-r--r-- | internal/api/client/admin/ruleget.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/internal/api/client/admin/ruleget.go b/internal/api/client/admin/ruleget.go index 8281092fb..28c0599f5 100644 --- a/internal/api/client/admin/ruleget.go +++ b/internal/api/client/admin/ruleget.go @@ -18,7 +18,6 @@ package admin import ( - "errors" "fmt" "net/http" @@ -85,10 +84,9 @@ func (m *Module) RuleGETHandler(c *gin.Context) { return } - ruleID := c.Param(IDKey) - if ruleID == "" { - err := errors.New("no rule id specified") - apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1) + ruleID, errWithCode := apiutil.ParseID(c.Param(apiutil.IDKey)) + if errWithCode != nil { + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } |