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-unsubscr...@nifi.apache.org

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

Reply via email to