async function getMovie(url) {
const responce = await fetch(url, {
method: 'GET'
})
if (!responce.ok) {
throw new Error('Ошибка получения JSON с сети по указанному url: ' + url)
}
return await responce.json()
}
(async () => {
try {
console.log(await getMovie('http://www.jsonkeeper.com/b/MU1J'))
}
catch (e) {
console.log(e)
}
})()