Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/facades/gradescope_facade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def provision_extension(course_id, student_email, assignment_id, new_due_date)

student_data = students_data['students'].find { |s| s['email'] == student_email }
unless student_data
Rails.logger.error "Failed to fetch assignment extensions: No response for student #{student_email}"
Rails.logger.error "Failed to fetch assignment extensions: Student #{student_email} not found"
return nil
end
student_id = student_data['id']
Expand Down
9 changes: 5 additions & 4 deletions lib/lmss/gradescope/client.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require 'faraday'
require 'faraday-cookie_jar'

require 'nokogiri'

require_relative 'error'

module Lmss
module Gradescope
class Client
Expand Down Expand Up @@ -91,11 +92,11 @@ def handle_response(response)
when 200..299
response.body
when 401, 403
raise Lmss::Gradescope::AuthenticationError, 'Authentication required'
raise AuthenticationErrors, 'Authentication required'
when 404
raise Lmss::Gradescope::NotFoundError, 'Resource not found'
raise NotFoundError, 'Resource not found'
else
raise Lmss::Gradescope::RequestError, "Request failed: #{status}"
raise RequestError, "Request failed: #{status}"
end
end
end
Expand Down
Loading