} catch (error) {
console.log('[PRODUCTS_GET]', error);
return new NextResponse("Internal error", { status: 500 });
}
// Adicione um retorno no final da função, caso nenhum dos retornos anteriores seja alcançado.
return new NextResponse("Internal error", { status: 500 });
})`
The client receives a 500 response even though the code execution has not finished.
GET `routerGET.get(async (req, res) => { try { const storeId = res.params.storeId; const { searchParams } = new URL(req.url);
} catch (error) { console.log('[PRODUCTS_GET]', error); return new NextResponse("Internal error", { status: 500 }); } // Adicione um retorno no final da função, caso nenhum dos retornos anteriores seja alcançado. return new NextResponse("Internal error", { status: 500 }); })`