Skip to content

Commit

Permalink
chore: improve error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Pagebakers committed Jan 27, 2025
1 parent 0f99242 commit cab90a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/website/src/pages/api/blocks/[category]/[component].ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ const getComponentFromRepo = async (
])

if (!codeResponse.ok) {
throw new Error('Component not found')
throw new Error(
`Component not found: ${templateRoot}/${categoryName}/${componentName}/${componentName}.tsx`,
{
cause: {
status: codeResponse.status,
statusText: codeResponse.statusText,
},
}
)
}

const code = await codeResponse.text()
Expand Down

0 comments on commit cab90a0

Please sign in to comment.