Advertisement
Guest User

Untitled

a guest
Jul 10th, 2021
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Resp = async (URL) => {
  2.     let response = await fetch(URL);
  3.  
  4.     if(!response.ok){
  5.        throw new Error(`Error status: ${response.status} from ${response.URL}`)
  6.     }
  7.  
  8.     return await response.text();
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement