kopia lustrzana https://github.com/learn-awesome/learndb
modified catch error block to give error message
rodzic
535ccfaefe
commit
60c6bc5e75
|
@ -103,9 +103,10 @@ export async function handler(event) {
|
||||||
body: JSON.stringify(fetchedContent),
|
body: JSON.stringify(fetchedContent),
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error('Error occurred:', error.message);
|
||||||
return {
|
return {
|
||||||
statusCode: 500,
|
statusCode: 500,
|
||||||
body: JSON.stringify({ error: 'Something went wrong' }),
|
body: JSON.stringify({ error: 'Something went wrong', details: error.message }),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
Ładowanie…
Reference in New Issue