Render error message when error is object

This commit is contained in:
Yarmo Mackenbach 2021-01-10 17:12:02 +01:00
parent a2afafa088
commit 8973052ba7
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -245,7 +245,11 @@ async function displayProfile(opts) {
fingerprint = sigVerification.publicKey.fingerprint;
} catch (e) {
feedback += `<p>There was a problem reading the signature.</p>`;
feedback += `<code>${e}</code>`;
if ('errors' in e) {
feedback += `<code>${e.errors.join(', ')}</code>`;
} else {
feedback += `<code>${e}</code>`;
}
document.body.querySelector('#profileData').innerHTML = feedback;
document.body.querySelector('#profileName').innerHTML = "Could not load profile";
return;