cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/4.2 to f328c7b
Date Mon, 22 Jul 2013 17:36:40 GMT
Updated Branches:
  refs/heads/4.2 b44c62085 -> f328c7b1a


CLOUDSTACK-3711: return descriptive error message to the regular user when his resource limit
has exceed. No harm in returning this info as the user aware of the resource limits/number
of resources available for allocation, for his account


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f328c7b1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f328c7b1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f328c7b1

Branch: refs/heads/4.2
Commit: f328c7b1aae5948e5b1139cc3bcbe138731f9f55
Parents: b44c620
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Jul 22 10:24:22 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Mon Jul 22 10:25:39 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiServer.java | 38 ++++++++--------------------
 1 file changed, 11 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f328c7b1/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index a1841af..42d3e6a 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -380,16 +380,13 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler,
ApiSer
                     }
                 }
             }
-        }
-        catch (InvalidParameterValueException ex){
+        } catch (InvalidParameterValueException ex){
             s_logger.info(ex.getMessage());
             throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ex.getMessage(), ex);
-        }
-        catch (IllegalArgumentException ex){
+        } catch (IllegalArgumentException ex){
             s_logger.info(ex.getMessage());
             throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ex.getMessage(), ex);
-        }
-        catch (PermissionDeniedException ex){
+        } catch (PermissionDeniedException ex){
             ArrayList<ExceptionProxyObject> idList = ex.getIdProxyList();
             if (idList != null) {
                 StringBuffer buf = new StringBuffer();
@@ -404,31 +401,21 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler,
ApiSer
                 s_logger.info("PermissionDenied: " + ex.getMessage());
             }
             throw new ServerApiException(ApiErrorCode.ACCOUNT_ERROR, ex.getMessage(), ex);
-        }
-        catch (AccountLimitException ex){
+        } catch (AccountLimitException ex){
             s_logger.info(ex.getMessage());
             throw new ServerApiException(ApiErrorCode.ACCOUNT_RESOURCE_LIMIT_ERROR, ex.getMessage(),
ex);
-        }
-        catch (InsufficientCapacityException ex){
+        } catch (InsufficientCapacityException ex){
             s_logger.info(ex.getMessage());
             String errorMsg = ex.getMessage();
             if (UserContext.current().getCaller().getType() != Account.ACCOUNT_TYPE_ADMIN){
                 // hide internal details to non-admin user for security reason
                 errorMsg = BaseCmd.USER_ERROR_MESSAGE;
-
             }
             throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, errorMsg,
ex);
-        }
-        catch (ResourceAllocationException ex){
+        } catch (ResourceAllocationException ex){
             s_logger.info(ex.getMessage());
-            String errorMsg = ex.getMessage();
-            if (UserContext.current().getCaller().getType() != Account.ACCOUNT_TYPE_ADMIN){
-                // hide internal details to non-admin user for security reason
-                errorMsg = BaseCmd.USER_ERROR_MESSAGE;
-            }
-            throw new ServerApiException(ApiErrorCode.RESOURCE_ALLOCATION_ERROR, errorMsg,
ex);
-        }
-        catch (ResourceUnavailableException ex){
+            throw new ServerApiException(ApiErrorCode.RESOURCE_ALLOCATION_ERROR, ex.getMessage(),
ex);
+        } catch (ResourceUnavailableException ex){
             s_logger.info(ex.getMessage());
             String errorMsg = ex.getMessage();
             if (UserContext.current().getCaller().getType() != Account.ACCOUNT_TYPE_ADMIN){
@@ -436,16 +423,13 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler,
ApiSer
                 errorMsg = BaseCmd.USER_ERROR_MESSAGE;
             }
             throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, errorMsg,
ex);
-        }
-        catch (AsyncCommandQueued ex){
+        } catch (AsyncCommandQueued ex){
             s_logger.error("unhandled exception executing api command: " + ((command == null)
? "null" : command[0]), ex);
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Internal server error,
unable to execute request.");
-        }
-        catch (ServerApiException ex){
+        } catch (ServerApiException ex){
             s_logger.info(ex.getDescription());
             throw ex;
-        }
-        catch (Exception ex){
+        } catch (Exception ex){
             s_logger.error("unhandled exception executing api command: " + ((command == null)
? "null" : command[0]), ex);
             String errorMsg = ex.getMessage();
             if (UserContext.current().getCaller().getType() != Account.ACCOUNT_TYPE_ADMIN){


Mime
View raw message