-
-
Save domcleal/51f8640b4072ee38cda0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/controllers/api/v2/hosts_controller.rb b/app/controllers/api/v2/hosts_controller.rb | |
index 9e69f29..c2443f8 100644 | |
--- a/app/controllers/api/v2/hosts_controller.rb | |
+++ b/app/controllers/api/v2/hosts_controller.rb | |
@@ -87,7 +87,10 @@ module Api | |
merge_interfaces(@host) | |
forward_request_url | |
- process_response @host.save | |
+ r = @host.save | |
+ log_resource_errors(@host) | |
+ @host.interfaces.map { |i| log_resource_errors(i) } | |
+ process_response r | |
rescue InterfaceTypeMapper::UnknownTypeExeption => e | |
render_error :custom_error, :status => :unprocessable_entity, :locals => { :message => e.to_s } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment