Skip to content

Commit

Permalink
error status code added
Browse files Browse the repository at this point in the history
  • Loading branch information
BarathaAberathne committed Jan 31, 2025
1 parent b9c74cc commit ea0eafd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var (
errs.ErrTypeMismatch: true,
errs.ErrDatasetTypeInvalid: true,
errs.ErrInvalidQueryParameter: true,
errs.ErrInvalidBody: true,
}

// errors that should return a 404 status
Expand Down
2 changes: 1 addition & 1 deletion api/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ func (api *DatasetAPI) addDatasetVersionCondensed(w http.ResponseWriter, r *http
newInstance, err = api.dataStore.Backend.AddInstance(ctx, newInstance)
if err != nil {
log.Error(ctx, "failed to add instance", err, logData)
handleDatasetAPIErr(ctx, errs.ErrInternalServer, w, nil)
handleDatasetAPIErr(ctx, errs.ErrInvalidBody, w, nil)
return
}

Expand Down

0 comments on commit ea0eafd

Please sign in to comment.