0
私は、指定された電子メールとパスワードのリストを使って、firebaseにループ(JS)経由で100人のユーザを登録しようとしています。例外をスキップするFirebase Javascript
しかし、それらのうちのいくつかは既に存在しており、電子メールのフォーマットが悪いものはほとんどありません。だからユーザの電子メールが既に登録されているか、またはひどくフォーマットされている場合は、というスクリプトが例外をスローします。そのユーザーの登録をスキップして、次のユーザーに続けます。
例外が発生した場合にループをスキップする方法。
for (var i = 0; i < data.length; i++){
//Variables of email and password
if (email !== '' && email !== undefined) {
const promise = firebase.auth().createUserWithEmailAndPassword(email, password)
.then(function(response) {
console.log(response.uid);
});
promise.catch(function(e){
console.log(e.message);
//Skip and continue to next iteration
});
}
}