change throw Error to console.log and return