function(error) {
// A full list of error codes is available at
// https://firebase.google.com/docs/storage/web/handle-errors
console.log(error);
switch (error.code) {
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 error.serverResponse
break;
}
}