DaanHoogland commented on a change in pull request #3976: Enable sending hypervior host name via metadata - VR and Config Drive URL: https://github.com/apache/cloudstack/pull/3976#discussion_r399299689
########## File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java ########## @@ -250,6 +281,9 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0. } catch (final TransformerException e) { s_logger.debug("TransformerException: " + e.getMessage()); result = e.getMessage(); + } catch (URISyntaxException e) { + s_logger.debug("UriSyntaxException: "+ e.getMessage()); + result = e.getMessage(); Review comment: this is a c&p of a bad pattern for two reasons: 1. the message if available should be explaining that it is a uri syntax issue. 1. as in most of the other catch clauses this can be replaced by something like `String.format("%s: %s", e.getClass().getSimpleName(), e.getMessage())`. And we should then unify the catch clauses. I suggest replacing with (something like): ``` } catch (final TimeoutException e) { s_logger.debug("Timed out while migrating domain: " + e.getMessage()); result = e.getMessage(); } catch (final IOException | ParserConfigurationException | SAXException | TransformerException | URISyntaxException e) { s_logger.debug(String.format("%s: %s", e.getClass().getSimpleName(), e.getMessage())); result = "Exception during migrate, see hypervisor for details; " + e.getMessage(); } finally { ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services