Skip to content

Commit

Permalink
fix: better handle remote primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Feb 24, 2024
1 parent efffdfa commit d66413c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ export default defineNuxtModule<ModuleOptions>({
}
})
.catch((err) => {
throw new Error(`Failed to fetch remote primitives: ${err?.data?.message || err.message}`)
let message = 'Project not found'
if (err.status === 500) {
message = 'Internal server error'
}
throw new Error(`Failed to fetch remote primitives: ${message}`)
})
logger.info(`Primitives available: ${Object.keys(primitives).filter(k => primitives[k]).map(k => `\`${k}\``).join(', ')} `)
return
Expand Down

0 comments on commit d66413c

Please sign in to comment.