Skip to content

Commit

Permalink
Send JSON error instead of entire 500 page error on autograde error (#…
Browse files Browse the repository at this point in the history
…1679)

* Update Slack invite links

* updated docs

* docker-compose slack invite

* render json error instead of full 500 error
  • Loading branch information
michellexliu committed Jan 9, 2023
1 parent 36e2af2 commit c3b7611
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/controllers/assessments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,18 @@ def getPartialFeedback
redirect_to(action: "index") && return
end

resp = get_job_status(job_id)
begin
resp = get_job_status(job_id)

if resp["is_assigned"]
resp['partial_feedback'] = tango_get_partial_feedback(job_id)
if resp["is_assigned"]
resp['partial_feedback'] = tango_get_partial_feedback(job_id)
end
rescue AutogradeError => e
render json: { error: "Get partial feedback request failed: #{e}" },
status: :internal_server_error
else
render json: resp.to_json
end

render json: resp.to_json
end

def parseScore(feedback)
Expand Down

0 comments on commit c3b7611

Please sign in to comment.