Errors are written to console.log instead of alert