File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export function useOrgPackages(orgName: MaybeRefOrGetter<string>) {
8989
9090 const asyncData = useLazyAsyncData (
9191 ( ) => `org-packages:${ searchProvider . value } :${ toValue ( orgName ) } ` ,
92- async ( { $npmRegistry, $npmApi } , { signal } ) => {
92+ async ( { $npmRegistry, $npmApi, ssrContext } , { signal } ) => {
9393 const org = toValue ( orgName )
9494 if ( ! org ) {
9595 return emptySearchResponse
@@ -120,11 +120,15 @@ export function useOrgPackages(orgName: MaybeRefOrGetter<string>) {
120120 } catch ( err ) {
121121 // Check if this is a 404 (org not found)
122122 if ( err && typeof err === 'object' && 'statusCode' in err && err . statusCode === 404 ) {
123- throw createError ( {
123+ const error = createError ( {
124124 statusCode : 404 ,
125125 statusMessage : 'Organization not found' ,
126126 message : `The organization "@${ org } " does not exist on npm` ,
127127 } )
128+ if ( import . meta. server ) {
129+ ssrContext ! . payload . error = error
130+ }
131+ throw error
128132 }
129133 // For other errors (network, etc.), return empty array to be safe
130134 packageNames = [ ]
You can’t perform that action at this time.
0 commit comments