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

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

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


##########
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:
   Should we log that an error occurred here so it would be possible to triage why "unknown" appears as a version?



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