Skip to content

Commit

Permalink
Raise an error in #course when course_uid is nil (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
grmnlrt authored Jan 30, 2024
1 parent 01e249f commit ec2a9b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/edusign/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class BadGatewayError < StandardError; end

class GatewayTimeoutError < StandardError; end

class CourseUidNilError < StandardError; end

def initialize(account_api_key: config.account_api_key)
@account_api_key = account_api_key

Expand Down Expand Up @@ -64,6 +66,8 @@ def delete_group(group_uid:)
# COURSE

def course(course_uid:)
raise CourseUidNilError, "Course UID can't be nil" if course_uid.blank?

response = api :get, "/course/#{course_uid}"
response.result
rescue Response::Error => e
Expand Down

0 comments on commit ec2a9b0

Please sign in to comment.