From b2e94685fbba483d399421d474c5ee2df3c5df38 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 3 Jun 2021 15:01:23 -0400 Subject: [PATCH] pad: Display error name in the gritter box --- src/static/js/pad_utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/static/js/pad_utils.js b/src/static/js/pad_utils.js index 8cc6efb1a..8a450d6fb 100644 --- a/src/static/js/pad_utils.js +++ b/src/static/js/pad_utils.js @@ -311,6 +311,9 @@ padutils.setupGlobalExceptionHandler = () => { } else { throw new Error(`unknown event: ${e.toString()}`); } + if (err.name != null && msg !== err.name && !msg.startsWith(`${err.name}: `)) { + msg = `${err.name}: ${msg}`; + } const errorId = randomString(20); let msgAlreadyVisible = false;