fixed bug
added error handlers for xhr and reader
handled errors in Promise.catch function