Skip to content

Commit

Permalink
feat(response): Update error responses to HTTP 200 because the web in…
Browse files Browse the repository at this point in the history
…terface will not show the user the error on a 500 response
  • Loading branch information
Zachary Seguin committed Aug 13, 2020
1 parent 4370e46 commit 73fafd8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ RUN CGO_ENABLED=0 go install .
FROM scratch
COPY --from=frontend /app/dist/out/default /static/
COPY --from=backend /go/bin/jupyter-apis /jupyter-apis
EXPOSE 5000
ENTRYPOINT [ "/jupyter-apis" ]
2 changes: 1 addition & 1 deletion httputils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *server) error(w http.ResponseWriter, r *http.Request, err error) {
log.Printf("returning error response: %v", err)

w.Header().Add("Content-Type", "application/json")
w.WriteHeader(http.StatusInternalServerError)
w.WriteHeader(http.StatusOK)
encoder := json.NewEncoder(w)
werr := encoder.Encode(APIResponse{
Success: false,
Expand Down

0 comments on commit 73fafd8

Please sign in to comment.