Skip to content
Snippets Groups Projects

cmd/gitserver/server: Handle warning error in handleRepoUpdate

Open Warren Gifford requested to merge ig/handle-warning-error into main

Created by: indradhanush

Note to reviewers: The diff is easier to see with whitespaces hidden.

In this commit we start handling a potential warning type error that might be returned from underlying functions. To do this we have to make some minor structural changes to this method:

  • We start returning early at the cost of a little bit of repeated code to JSON encode the response
  • This also has the positive side effect of reducing nesting in the code

Test plan

The updated code path to return the custom 555 status code is technically dead code since none of the underlying methods return a warning type error yet. Once implemented, I will add tests in the client to handle this status code –– which is where the new effect of this code change will be truly seen.

Merge request reports

The source branch ig/handle-warning-error does not exist. Please restore it or use a different source branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading