Skip to content

Commit

Permalink
UI-57 - Fix superfluous header writing (#62)
Browse files Browse the repository at this point in the history
Signed-off-by: SammyOina <[email protected]>
  • Loading branch information
SammyOina authored Jan 5, 2024
1 parent 0264291 commit 4047e5d
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions ui/api/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2321,43 +2321,43 @@ func encodeError(_ context.Context, err error, w http.ResponseWriter) {
}
return
}
}
switch err {
case errMissingSecret,
errMissingIdentity,
errLimitSize,
errPageSize,
errMissingConfigID,
errMissingMetadata,
errMissingEmail,
errMissingName,
errMissingChannel,
errMissingPayload,
errMissingPassword,
errMissingError,
errMissingRefreshToken,
errMissingRef,
errMissingConfirmPassword,
errNameSize,
errBearerKey,
errMissingOwner,
errMissingItem,
errMissingThingID,
errMissingChannelID,
errMissingDomainID,
errMissingUserID,
errMissingRelation,
errMissingGroupID,
errMissingParentID,
errMissingDescription,
errMissingThingKey,
errMissingExternalID,
errMissingRole,
errMissingValue,
errMissingExternalKey:
w.Header().Set("X-Error-Message", err.Error())
w.WriteHeader(http.StatusBadRequest)
default:
w.WriteHeader(http.StatusBadRequest)
switch err {
case errMissingSecret,
errMissingIdentity,
errLimitSize,
errPageSize,
errMissingConfigID,
errMissingMetadata,
errMissingEmail,
errMissingName,
errMissingChannel,
errMissingPayload,
errMissingPassword,
errMissingError,
errMissingRefreshToken,
errMissingRef,
errMissingConfirmPassword,
errNameSize,
errBearerKey,
errMissingOwner,
errMissingItem,
errMissingThingID,
errMissingChannelID,
errMissingDomainID,
errMissingUserID,
errMissingRelation,
errMissingGroupID,
errMissingParentID,
errMissingDescription,
errMissingThingKey,
errMissingExternalID,
errMissingRole,
errMissingValue,
errMissingExternalKey:
w.Header().Set("X-Error-Message", err.Error())
w.WriteHeader(http.StatusBadRequest)
default:
w.WriteHeader(http.StatusBadRequest)
}
}
}

0 comments on commit 4047e5d

Please sign in to comment.