Skip to content
Prev Previous commit
Next Next commit
Ex1 error handling is added
  • Loading branch information
amirhshad committed Dec 13, 2020
commit 0f3b67f08e5e60f99ca5d4e16ee9e61835c0cbc0
6 changes: 6 additions & 0 deletions Week1/homework/js-exercises/getandomUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ function processRequest(e) {
}
}

xhr.onerror = function() {
if (xhr.status != 200) {
alert (`Error ${xhr.status}: ${xhr.statusText}`)
}
}

}


Expand Down
Empty file.