Github user DaanHoogland commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/643#discussion_r35860179
--- Diff: server/src/org/apache/cloudstack/region/RegionsApiUtil.java ---
@@ -186,8 +186,12 @@ protected static UserAccount
makeUserAccountAPICall(Region region, String comman
XStream xstream = new XStream(new DomDriver());
xstream.alias("useraccount", UserAccountVO.class);
xstream.aliasField("id", UserAccountVO.class, "uuid");
- ObjectInputStream in = xstream.createObjectInputStream(is);
- return (UserAccountVO)in.readObject();
+ try(ObjectInputStream in =
xstream.createObjectInputStream(is);) {
+ return (UserAccountVO)in.readObject();
+ } catch (IOException e) {
+ s_logger.error(e.getMessage());
+ return null;
--- End diff --
this return is not needed. we will fall through to other return. You can
opt not to and put another log message in there as well.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---