Skip to content

Commit 426867c

Browse files
committed
patch error handling
1 parent 7026257 commit 426867c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

js/copy-to-llm.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
}
1616
function buildSlugFromPath(pathname) {
1717
const route = (pathname || '').replace(/^\/+|\/+$/g, '');
18-
return route
19-
.split('/')
20-
.filter(Boolean)
21-
.join('-');
18+
return route.split('/').filter(Boolean).join('-');
2219
}
2320

2421
function getPageSlug() {
@@ -362,11 +359,9 @@
362359
let copySucceeded = false;
363360
const slug = getPageSlug();
364361

365-
const { text, status } = await fetchMarkdown(slug);
362+
const { text } = await fetchMarkdown(slug);
366363

367-
if (status === 404) {
368-
showToast(NO_MARKDOWN_MESSAGE);
369-
} else if (text) {
364+
if (text) {
370365
copySucceeded = await copyToClipboard(
371366
text,
372367
copyButton,

0 commit comments

Comments
 (0)