You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "markobean (via GitHub)" <gi...@apache.org> on 2023/03/20 13:46:46 UTC

[GitHub] [nifi] markobean commented on a diff in pull request #7057: NIFI-11302: add Registry version to About dialog fixing bug for Java 11

markobean commented on code in PR #7057:
URL: https://github.com/apache/nifi/pull/7057#discussion_r1142148320


##########
nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/web/api/RegistryAboutResource.java:
##########
@@ -56,8 +59,13 @@ public RegistryAboutResource(
             response = RegistryAbout.class
     )
     public Response getVersion() {
-        final String implVersion = NiFiRegistryApiApplication.class.getPackage().getImplementationVersion();
-        final RegistryAbout version = new RegistryAbout(implVersion);
-        return Response.status(Response.Status.OK).entity(version).build();
+        Properties props = new Properties();
+        try (InputStream stream = getClass().getResourceAsStream(PROPERTIES_FILE)){
+            props.load(stream);
+        } catch (IOException e) {
+            return Response.status(Response.Status.OK).entity("unknown").build();

Review Comment:
   Added log message for exception



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org