Skip to content

Commit

Permalink
Always display error details
Browse files Browse the repository at this point in the history
Before this we'd hide error details behind a `<details>` element, but
all error messages I've seen so far were very short, meaning they'd fit
perfectly well on the page.

These changes always show the error message, which makes error pages
more consistent and avoid styling issues re. the more dynamic page.
  • Loading branch information
nmattia committed Sep 30, 2022
1 parent 771a485 commit d741016
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 4 additions & 8 deletions src/frontend/src/components/displayError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ const pageContent = (options: ErrorOptions) => html`
${warnBox({
title: options.title,
message: options.message,
htmlElement: "div",
slot:
options.detail !== undefined
? html`<details class="displayErrorDetail">
<summary class="c-summary">
<span class="c-summary__link t-link">Error details</span>
</summary>
<pre class="t-paragraph">${options.detail}</pre>
</details>`
? html`<div class="l-divider"></div>
<h4>Error details:</h4>
<pre data-role="error-detail" class="t-paragraph">${options.detail}</pre>`
: undefined,
htmlElement: "div",
})}
<div class="l-stack">
Expand Down
3 changes: 1 addition & 2 deletions src/frontend/src/test-e2e/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,8 @@ export class ErrorView extends View {
}

async getErrorDetail(): Promise<string> {
await this.browser.$(".displayErrorDetail").click();
return (
await this.browser.$(".displayErrorDetail > pre:nth-child(2)")
await this.browser.$('[data-role="error-details"]')
).getText();
}

Expand Down

0 comments on commit d741016

Please sign in to comment.