From ffff47d6355caa4fe39a87dd4688db4a8d31b014 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Mon, 11 Nov 2024 18:10:45 +0100 Subject: [PATCH] toasty error messages --- templates/repo/settings/branches.tmpl | 2 +- web_src/js/features/repo-settings-branches.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl index be91c6636b..aa24846a06 100644 --- a/templates/repo/settings/branches.tmpl +++ b/templates/repo/settings/branches.tmpl @@ -39,7 +39,7 @@
{{range .ProtectedBranches}} -
+
{{svg "octicon-grabber" 16}} diff --git a/web_src/js/features/repo-settings-branches.ts b/web_src/js/features/repo-settings-branches.ts index 90ef6e9f67..525b3340e9 100644 --- a/web_src/js/features/repo-settings-branches.ts +++ b/web_src/js/features/repo-settings-branches.ts @@ -1,5 +1,6 @@ import {createSortable} from '../modules/sortable.ts'; import {POST} from '../modules/fetch.ts'; +import {showErrorToast} from '../modules/toast.ts'; export function initRepoBranchesSettings() { const protectedBranchesList = document.querySelector('#protected-branches-list'); @@ -21,7 +22,8 @@ export function initRepoBranchesSettings() { }, }); } catch (err) { - console.error('Failed to update branch protection rule priority:', err); + const errorMessage = String(err); + showErrorToast(`Failed to update branch protection rule priority:, error: ${errorMessage}`); } }, });