Skip to content

Commit a242618

Browse files
authored
Improve key-missing error message (#37)
1 parent 4fc3b87 commit a242618

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

front-end/src/App.svelte

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
const { key } = parsePath();
2626
if (!key) {
2727
setError({
28-
status: 404,
29-
title: "Question not found",
28+
status: 400,
29+
title:
30+
"Question key is missing. Please ask for a valid link to the feedback form.",
3031
});
3132
return;
3233
}
@@ -80,14 +81,15 @@
8081
{:else if error}
8182
<Error {error} />
8283
{/if}
83-
{#if question && view === "form"}
84-
<Form {question} />
85-
{:else if question && view === "summary"}
86-
<Summary {question} />
87-
{:else if question && view === "share"}
88-
<Share {question} />
89-
{/if}
84+
9085
{#if question}
86+
{#if view === "form"}
87+
<Form {question} />
88+
{:else if view === "summary"}
89+
<Summary {question} />
90+
{:else if view === "share"}
91+
<Share {question} />
92+
{/if}
9193
<div class="links">
9294
{#if view !== "form"}
9395
<Link target={`/${question.key}`}>Submit an answer</Link>

0 commit comments

Comments
 (0)