Skip to content

Extends error response#19

Open
quanganh wants to merge 1 commit intodevelopfrom
extend-error-response
Open

Extends error response#19
quanganh wants to merge 1 commit intodevelopfrom
extend-error-response

Conversation

@quanganh
Copy link
Copy Markdown

No description provided.

@quanganh quanganh force-pushed the extend-error-response branch from b188cb6 to 501d583 Compare January 18, 2018 11:46
Comment thread lib/moodle_rb/utility.rb
def check_for_errors(response)
return unless error_response?(response)
raise MoodleError.new(response.parsed_response)
raise MoodleError.new(response.parsed_response.presence || response.response.inspect)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

006:0> response.parsed_response.presence || response.response.inspect
=> "#<Net::HTTPInternalServerError 500 Internal Server Error readbody=true>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any chance we could add a spec to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants