This commit is contained in:
Philippe Torrel
2026-09-28 09:42:41 +02:00
parent 8a2d979830
commit 80296c10d0
6 changed files with 89 additions and 16 deletions
@@ -28,14 +28,14 @@
try {
const response = await fetch('https://dummyjson.com/posts');
if (!response.ok) {
throw new Error('HTTP-Reponse Error');
throw new Error('HTTP-Response Error');
}
const data = await response.json();
return data; // Rückgabe ist async -> Promise
} catch (error) {
console.error('Fetch operation error: ', error);
// console.error('Fetch operation error: ', error);
throw error;
}