diff --git a/app/page.js b/app/page.js index 4041ca6..9cf2db9 100644 --- a/app/page.js +++ b/app/page.js @@ -49,16 +49,12 @@ async function getData() { }) ) - if (titres.length === 0 || articles.length === 0) { - throw new Error('No data') - } - return { titres, articles } - } catch { - throw new Error('Failed to fetch data') + } catch (error) { + throw new Error(error.cause) } }