ErrorFallback: update discussion title to include error code and status if provided

This commit is contained in:
Sidney Alcantara
2022-10-25 16:54:54 +11:00
parent 144bfbe2dd
commit c5cd485e70

View File

@@ -44,12 +44,21 @@ export function ErrorFallbackContents({
size={props.basic ? "small" : "medium"}
href={
EXTERNAL_LINKS.gitHub +
"/discussions/new?labels=bug&category=support-q-a&title=" +
encodeURIComponent("Error: " + error.message.replace("\n", " ")) +
"&body=" +
encodeURIComponent(
"👉 **Please describe how to reproduce this bug here.**"
)
"/discussions/new?" +
new URLSearchParams({
labels: "bug",
category: "support-q-a",
title: [
"Error",
(error as any).code,
(error as any).status,
error.message,
]
.filter(Boolean)
.join(": ")
.replace(/\n/g, " "),
body: "👉 **Please describe how to reproduce this bug here.**",
}).toString()
}
target="_blank"
rel="noopener noreferrer"