diff --git a/2-copy-of-code/lesson-18/lesson18.html b/2-copy-of-code/lesson-18/lesson18.html index 1c1c350..b60a730 100644 --- a/2-copy-of-code/lesson-18/lesson18.html +++ b/2-copy-of-code/lesson-18/lesson18.html @@ -50,9 +50,14 @@ */ async function getAmazon() { - const response = await fetch('https://amazon.com'); - const text = await response.text(); - console.log(text); + try { + const response = await fetch('https://amazon.com'); + const text = await response.text(); + console.log(text); + + } catch (error) { + console.log('CORS error. You request was blocked by the backend.'); + } } getAmazon();