This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-console.git

commit d3833c625efb1c45f6d9108c6020029241f9fa01
Author: Grzegorz Grzybek <[email protected]>
AuthorDate: Thu Nov 13 15:33:26 2025 +0100

    ARTEMIS-5760: reject the promises for getting MBean attributes after 
exception
---
 .../packages/artemis-console-plugin/src/artemis-service.ts   | 10 ++++++++--
 .../packages/artemis-console-plugin/src/status/Status.tsx    | 12 ++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git 
a/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/artemis-service.ts
 
b/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/artemis-service.ts
index ea5edfd..c25e5b1 100644
--- 
a/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/artemis-service.ts
+++ 
b/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/artemis-service.ts
@@ -269,7 +269,10 @@ class ArtemisService {
                     acceptors: []
                 };
                 for (const key in search) {
-                    const acceptor: Acceptor = await 
jolokiaService.readAttributes(search[key]) as Acceptor;
+                    const acceptor: Acceptor = await 
jolokiaService.readAttributes(search[key])
+                        .catch((e) => {
+                            reject(e)
+                        }) as Acceptor;
                     acceptors.acceptors.push(acceptor);
                 }
                 resolve(acceptors);
@@ -289,7 +292,10 @@ class ArtemisService {
                     clusterConnections: []
                 };
                 for (const key in search) {
-                    const clusterConnection: ClusterConnection = await 
jolokiaService.readAttributes(search[key]) as ClusterConnection;
+                    const clusterConnection: ClusterConnection = await 
jolokiaService.readAttributes(search[key])
+                        .catch((e) => {
+                            reject(e)
+                        }) as ClusterConnection;
                     
clusterConnections.clusterConnections.push(clusterConnection);
                 }
                 resolve(clusterConnections);
diff --git 
a/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/status/Status.tsx
 
b/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/status/Status.tsx
index cdbc021..a250f98 100644
--- 
a/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/status/Status.tsx
+++ 
b/artemis-console-extension/artemis-extension/packages/artemis-console-plugin/src/status/Status.tsx
@@ -61,10 +61,10 @@ export const Status: React.FunctionComponent = () => {
             .then((brokerInfo) => {
                 setBrokerInfo(brokerInfo ?? undefined)
             })
-            .catch((error: string) => {
+            .catch((error: string | { [key: string]: any }) => {
                 eventService.notify({
                     type: 'warning',
-                    message: error,
+                    message: typeof error === 'object' ? ('error' in error ? 
error.error : JSON.stringify(error)) : error,
                 })
             });
     }
@@ -74,10 +74,10 @@ export const Status: React.FunctionComponent = () => {
             .then((acceptors) => {
                 setAcceptors(acceptors)
             })
-            .catch((error: string) => {
+            .catch((error: string | { [key: string]: any }) => {
                 eventService.notify({
                     type: 'warning',
-                    message: error,
+                    message: typeof error === 'object' ? ('error' in error ? 
error.error : JSON.stringify(error)) : error,
                 })
             });
     }
@@ -87,10 +87,10 @@ export const Status: React.FunctionComponent = () => {
             .then((clusterConnections) => {
                 setClusterConnections(clusterConnections)
             })
-            .catch((error: string) => {
+            .catch((error: string | { [key: string]: any }) => {
                 eventService.notify({
                     type: 'warning',
-                    message: error,
+                    message: typeof error === 'object' ? ('error' in error ? 
error.error : JSON.stringify(error)) : error,
                 })
             });
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to