You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f4caf14
Browse filesBrowse the repository at this point in the historyBrowse files
Kris McQueen
committed
Refactoring dispatching API commands from the scheduled async job. Instead of calling an executor, the dispatcher invokes the method on the manager directly. After the command is executed the response is serialized to the async job table so it can be queried later. Also serialize a response for async create commands that includes the id of the object being created.
thrownewServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getName() + " due to missing parameter " + parameterAnnotation.name());
s_logger.debug("Unable to execute API command " + cmd.getName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name());
74
-
}
75
-
thrownewServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name());
76
-
} catch (ParseExceptionparseEx) {
77
-
if (s_logger.isDebugEnabled()) {
78
-
s_logger.debug("Invalid date parameter " + paramObj + " passed to command " + cmd.getName());
79
-
}
80
-
thrownewServerApiException(BaseCmd.PARAM_ERROR, "Unable to parse date " + paramObj + " for command " + cmd.getName() + ", please pass dates in the format yyyy-MM-dd");
81
-
} catch (CloudRuntimeExceptioncloudEx) {
82
-
// FIXME: Better error message? This only happens if the API command is not executable, which typically means there was
83
-
// and IllegalAccessException setting one of the parameters.
84
-
thrownewServerApiException(BaseCmd.INTERNAL_ERROR, "Internal error executing API command " + cmd.getName());
thrownewServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getName() + " due to missing parameter " + parameterAnnotation.name());
162
+
}
163
+
continue;
164
+
}
165
+
166
+
// marshall the parameter into the correct type and set the field value
s_logger.debug("Unable to execute API command " + cmd.getName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name());
172
+
}
173
+
thrownewServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name());
174
+
} catch (ParseExceptionparseEx) {
175
+
if (s_logger.isDebugEnabled()) {
176
+
s_logger.debug("Invalid date parameter " + paramObj + " passed to command " + cmd.getName());
177
+
}
178
+
thrownewServerApiException(BaseCmd.PARAM_ERROR, "Unable to parse date " + paramObj + " for command " + cmd.getName() + ", please pass dates in the format yyyy-MM-dd");
179
+
} catch (CloudRuntimeExceptioncloudEx) {
180
+
// FIXME: Better error message? This only happens if the API command is not executable, which typically means there was
181
+
// and IllegalAccessException setting one of the parameters.
182
+
thrownewServerApiException(BaseCmd.INTERNAL_ERROR, "Internal error executing API command " + cmd.getName());
0 commit comments