modified catch error block to give error message

pull/73/head
Huda Joad 2023-11-24 23:44:21 +03:00
rodzic 535ccfaefe
commit 60c6bc5e75
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -103,9 +103,10 @@ export async function handler(event) {
body: JSON.stringify(fetchedContent),
};
} catch (error) {
console.error('Error occurred:', error.message);
return {
statusCode: 500,
body: JSON.stringify({ error: 'Something went wrong' }),
body: JSON.stringify({ error: 'Something went wrong', details: error.message }),
};
}
}