From 8973052ba7d1cbdecc43fe4f7ab726727b5022b8 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sun, 10 Jan 2021 17:12:02 +0100 Subject: [PATCH] Render error message when error is object --- static/scripts.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/scripts.js b/static/scripts.js index b6472f8..f32de68 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -245,7 +245,11 @@ async function displayProfile(opts) { fingerprint = sigVerification.publicKey.fingerprint; } catch (e) { feedback += `

There was a problem reading the signature.

`; - feedback += `${e}`; + if ('errors' in e) { + feedback += `${e.errors.join(', ')}`; + } else { + feedback += `${e}`; + } document.body.querySelector('#profileData').innerHTML = feedback; document.body.querySelector('#profileName').innerHTML = "Could not load profile"; return;