号
それが存在しているかいない場合は、をチェックするためにダウンロードする必要があります。 Firebase APIは、失敗した理由を示す適切なエラーで応答します。
は、エラーを処理するcatch
ブロックを使用します。
.catch(function(error) {
switch (error.code) {
case 'storage/object_not_found': // <<< here you decide what to do when the file doesn't exist
// File doesn't exist
break;
case 'storage/unauthorized':
// User doesn't have permission to access the object
break;
case 'storage/canceled':
// User canceled the upload
break;
...
case 'storage/unknown':
// Unknown error occurred, inspect the server response
break;
}
});
エラーコードの完全なリストはhere可能です。
私が見るああ、ありますか? – Learning2code
あなたはコンソールにそれを書いています。キャッチブロックを見てください。その行を削除しても表示されません。 – Shaharyar
申し訳ありませんが、私はconsole.logエラーを意味しませんでした。コンソールでポップアップし続けるエラーのスクリーンショットを表示するために投稿を編集しました。これを隠すか、それが表示されないようにしたいのです – Learning2code