Skip to content

Conversation

@arvindh123
Copy link
Contributor

What type of PR is this?

What does this do?

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Did you document any new/modified feature?

Notes

@arvindh123 arvindh123 requested a review from a team as a code owner October 6, 2025 11:26
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
@arvindh123 arvindh123 moved this to 🚧 In Progress in SuperMQ Nov 4, 2025
Comment on lines +187 to +201
switch retErr := err.(type) {
case errors.RequestError:
w.WriteHeader(http.StatusBadRequest)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
case errors.AuthNError, errors.AuthZError:
w.WriteHeader(http.StatusUnauthorized)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this type switch replace the big switch case defined below?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚧 In Progress

Development

Successfully merging this pull request may close these issues.

2 participants