Skip to content

Commit

Permalink
feat: add matrix category support
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Aug 29, 2022
1 parent c8c3bb3 commit 86fb8c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/server/httpserver/error.go
Expand Up @@ -75,6 +75,11 @@ func ErrorHandler(ctx *fiber.Ctx, err error) error {
return HandleCustomError(ctx, pgerr.ErrInvalidReq)
}

if e, ok := err.(*pgerr.PenguinError); ok {
// Use custom error handler if it's a custom error
return HandleCustomError(ctx, e)
}

// must be an unexpected runtime error then
log.Error().
Stack().
Expand Down
2 changes: 1 addition & 1 deletion internal/util/rekuest/validate.go
Expand Up @@ -175,7 +175,7 @@ func ValidServer(ctx *fiber.Ctx, server string) error {

func ValidCategory(ctx *fiber.Ctx, category string) error {
type request struct {
Category string `validate:"oneof=automated manual"`
Category string `validate:"oneof=all automated manual"`
}

if err := ValidStruct(ctx, request{category}); err != nil {
Expand Down

0 comments on commit 86fb8c7

Please sign in to comment.