Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Admin errors response handling #229

Merged
merged 2 commits into from
Mar 31, 2023
Merged
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/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def _process_ontologies(success_keyword, error_keyword, process_proc)

if ontology
error_response = self.send(process_proc, ontology, params)
if error_response
if response_error?(error_response)
errors = response_errors(error_response) # see application_controller::response_errors
_process_errors(errors, response, false)
else
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def response_errors(error_response)
end

def response_success?(response)
return false if response.nil?
return true if response.nil?

if response.respond_to?(:status) && response.status
response.status.to_i < 400
Expand Down