From e0f24cc2681ea20bac70aeddaa82b96055ba257a Mon Sep 17 00:00:00 2001 From: nasc17 <69922333+nasc17@users.noreply.github.com> Date: Fri, 26 Mar 2021 08:30:42 -0700 Subject: [PATCH] Add try catch block to model refresh in compute/storage pages (#14861) * Add try catch block to model refresh in compute/storage pages * spacing --- .../src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts | 7 +++++-- .../dashboards/postgres/postgresComputeAndStoragePage.ts | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts b/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts index e37aee8b48..8cc8a7ad88 100644 --- a/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts +++ b/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts @@ -140,8 +140,11 @@ export class MiaaComputeAndStoragePage extends DashboardPage { } finally { session?.dispose(); } - - await this._miaaModel.refresh(); + try { + await this._miaaModel.refresh(); + } catch (error) { + vscode.window.showErrorMessage(loc.refreshFailed(error)); + } } ); diff --git a/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts b/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts index e615a19228..bb161bcc59 100644 --- a/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts +++ b/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts @@ -217,7 +217,11 @@ export class PostgresComputeAndStoragePage extends DashboardPage { } finally { session?.dispose(); } - await this._postgresModel.refresh(); + try { + await this._postgresModel.refresh(); + } catch (error) { + vscode.window.showErrorMessage(loc.refreshFailed(error)); + } } );