Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan committed Dec 9, 2024
1 parent fbe5b69 commit f4084e4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/plugins/code-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ function getCodeSnippet({ code, lines, snippetName }) {
async function fetchSnippet(url, { lines, snippetName }) {
const codeResponse = await fetch(url);
if (!codeResponse.ok) {
throw new Error(`Failed to fetch code from ${url}: ${codeResponse.statusText}`);
throw new Error(
`Failed to fetch code from ${url}: ${codeResponse.statusText}`,
);
}
const code = await codeResponse.text();
const snippet = getCodeSnippet({ code, lines, snippetName });
Expand Down Expand Up @@ -196,7 +198,12 @@ function plugin() {
}
node.value = snippet;
} catch (error) {
console.error(`Error processing snippet from ${url}:`, error.message);
// Log the error for debugging
console.error(
`Error processing snippet from ${url}:`,
error.message,
);
// Re-throw the error to propagate it
throw error;
}
})();
Expand Down

0 comments on commit f4084e4

Please sign in to comment.