From c68d54a5ed5c87992f05965795ef63b1aa292169 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Mon, 30 Sep 2024 16:42:33 -0400 Subject: [PATCH] Don't show snackbar on rlock-load failure if 403 (#2574) ACCOUNT_MANAGER users don't have permission to see locks so it'll throw 403s. That's OK, we don't need/want to display that error to the client. --- console-webapp/src/app/domains/domainList.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/console-webapp/src/app/domains/domainList.component.ts b/console-webapp/src/app/domains/domainList.component.ts index 8a982a0a7..c29e515bf 100644 --- a/console-webapp/src/app/domains/domainList.component.ts +++ b/console-webapp/src/app/domains/domainList.component.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HttpErrorResponse } from '@angular/common/http'; +import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http'; import { Component, ViewChild, effect } from '@angular/core'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatSnackBar } from '@angular/material/snack-bar'; @@ -91,7 +91,10 @@ export class DomainListComponent { loadLocks() { this.registryLockService.retrieveLocks().subscribe({ error: (err: HttpErrorResponse) => { - this._snackBar.open(err.message); + if (err.status !== HttpStatusCode.Forbidden) { + // Some users may not have registry lock permissions and that's OK + this._snackBar.open(err.message); + } }, }); }