Skip to content

Commit

Permalink
fix: update error test to return enum field
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanSpeakEasy committed Oct 10, 2023
1 parent 7ab1d1d commit 9c2903a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/errors/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func HandleErrors(w http.ResponseWriter, r *http.Request) {
if err := json.NewEncoder(w).Encode(models.Error{
Code: statusCode,
Message: "an error occurred",
Type: "internal",
}); err != nil {
utils.HandleError(w, err)
return
Expand Down
1 change: 1 addition & 0 deletions pkg/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package models
type Error struct {
Message string `json:"message"`
Code string `json:"code"`
Type string `json:"type"`
}

type ErrorResponse struct {
Expand Down

0 comments on commit 9c2903a

Please sign in to comment.