Skip to content

Commit

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

* Update Slack invite links

* updated docs

* docker-compose slack invite

* render json error instead of full 500 error
  • Loading branch information
michellexliu authored and cg2v committed Jan 10, 2023
1 parent aecae19 commit 1d6bd2e
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 @@ -617,13 +617,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 1d6bd2e

Please sign in to comment.