This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user