Displaying 2 results from an estimated 2 matches for "perm_error".
2009 May 20
1
[PATCH server] don't add nil key to failures hash for PartialSuccessError handling.
...90df7..efd3cb6 100644
--- a/src/app/controllers/resources_controller.rb
+++ b/src/app/controllers/resources_controller.rb
@@ -80,10 +80,9 @@ class ResourcesController < PoolController
begin
svc_destroy(pool_id)
successes << @pool
- rescue PermissionError => perm_error
- failures[@pool] = perm_error.message
+ # PermissionError expected
rescue Exception => ex
- failures[@pool] = ex.message
+ failures[@pool.nil? ? pool_id : @pool] = ex.message
end
end
unless failures.empty?
diff --git a/src/app/controllers/storag...
2009 May 15
0
[PATCH server] use service layer for Network controller.
...calize_error_messages.to_a }
+ def delete
+ network_ids = params[:network_ids].split(",")
+ successes = []
+ failures = {}
+ network_ids.each do |network_id|
+ begin
+ svc_destroy(network_id)
+ successes << @network
+ rescue PermissionError => perm_error
+ failures[@network] = perm_error.message
+ rescue ActionError => ex
+ failures[@network] = ex.message
+ rescue Exception => ex
+ failures[@network] = ex.message
+ end
end
- end
-
- def delete
- failed_networks = []
- networks_ids_str = par...