From 8f34d83c15da8a7a9fd9fadaed09ed5f12bf0efa Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Fri, 26 Jan 2024 10:13:16 -0800 Subject: [PATCH] Redirect on reapply error (#2114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 🤖 redirect to list on reapply error --- .../session-recording/channels-by-connection.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js index 04b5f2c31..8ef58b596 100644 --- a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js +++ b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js @@ -12,7 +12,7 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne // =services @service store; @service session; - + @service router; // =methods /** @@ -50,7 +50,6 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne storageBucket, }; } - /** * Reapplies storage policy dates to session recording * @param {SessionRecordingModel} @@ -63,7 +62,12 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne : 'resources.policy.messages.reapply', ) async reapplyStoragepolicy(sessionRecording) { - await sessionRecording.reapplyStoragePolicy(); - super.refresh(...arguments); + try { + await sessionRecording.reapplyStoragePolicy(); + } catch (e) { + await this.router.replaceWith('scopes.scope.session-recordings'); + this.router.refresh(); + throw new Error(e); + } } }