Skip to content

Commit

Permalink
Fix http error codes (#125)
Browse files Browse the repository at this point in the history
* core: rearrange fields to reduce struct size

Signed-off-by: Isabella do Amaral <[email protected]>

* ignore debug files

Signed-off-by: Isabella do Amaral <[email protected]>

* api: fix http status error conversion

Signed-off-by: Isabella do Amaral <[email protected]>

---------

Signed-off-by: Isabella do Amaral <[email protected]>
  • Loading branch information
isinyaaa authored Jun 4, 2024
1 parent e4cdc0a commit 766ec09
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# Test binary, built with `go test -c`
*.test

__debug*

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
)

func ErrToStatus(err error) int {
switch err {
switch errors.Unwrap(err) {
case ErrBadRequest:
return http.StatusBadRequest
case ErrNotFound:
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
// ModelRegistryService is the core library of the model registry
type ModelRegistryService struct {
mlmdClient proto.MetadataStoreServiceClient
nameConfig mlmdtypes.MLMDTypeNamesConfig
typesMap map[string]int64
mapper *mapper.Mapper
openapiConv *generated.OpenAPIConverterImpl
nameConfig mlmdtypes.MLMDTypeNamesConfig
}

// NewModelRegistryService creates a new instance of the ModelRegistryService, initializing it with the provided gRPC client connection.
Expand Down

0 comments on commit 766ec09

Please sign in to comment.