Skip to content

Commit

Permalink
Merge pull request #261 from ontoportal-lirmm/pr/fix/response-error-h…
Browse files Browse the repository at this point in the history
…andeling

Fix: ontology delete response error handelling
  • Loading branch information
alexskr authored Apr 6, 2023
2 parents bb81ec4 + 00c0626 commit f344969
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,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 @@ -196,7 +196,7 @@ def response_errors(error_struct)
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

0 comments on commit f344969

Please sign in to comment.