Gestire gli errori con Cloud Storage per C++
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
A volte, durante la creazione di un'app, le cose non vanno come previsto e si verifica un errore.
In caso di dubbi, controlla l'errore restituito e il messaggio di errore.
Se hai controllato il messaggio di errore e disponi di Cloud Storage Security Rules che ti consentono di eseguire l'azione, ma hai ancora difficoltà a risolvere l'errore, visita la nostra pagina di assistenza e comunicaci come possiamo aiutarti.
Gestire i messaggi di errore
Esistono diversi motivi per cui potrebbero verificarsi errori, tra cui il file
non esistente, l'utente che non dispone dell'autorizzazione per accedere al file desiderato o
l'utente che annulla il caricamento del file.
Per diagnosticare correttamente il problema e gestire l'errore, ecco un elenco completo di
tutti gli errori che il nostro client genererà e come possono verificarsi.
Nome |
Motivo |
kErrorNone |
Non si è verificato alcun errore. |
kErrorUnknown |
Si è verificato un errore sconosciuto. |
kErrorObjectNotFound |
Non esiste alcun oggetto nel riferimento specificato. |
kErrorBucketNotFound |
Nessun bucket configurato per Cloud Storage. |
kErrorProjectNotFound |
Nessun progetto è configurato per Cloud Storage. |
kErrorQuotaExceeded |
La quota del bucket Cloud Storage è stata superata. Se hai scelto il piano tariffario Spark, valuta l'upgrade al piano tariffario Blaze con pagamento a consumo. Se hai già scelto il piano tariffario Blaze, contatta l'assistenza Firebase.
Importante: a partire dal 1° ottobre 2025, il piano tariffario Blaze sarà obbligatorio per utilizzare Cloud Storage, anche i bucket predefiniti. |
kErrorUnauthenticated |
L'utente non è autenticato. Autenticati e riprova. |
kErrorUnauthorized |
L'utente non è autorizzato a eseguire l'azione richiesta. Controlla le regole per assicurarti che siano corrette. |
kErrorRetryLimitExceeded |
È stato superato il limite di tempo massimo per un'operazione (caricamento, download, eliminazione e così via). Prova a caricarlo di nuovo. |
kErrorNonMatchingChecksum |
Il file sul client non corrisponde al checksum del file ricevuto dal server. Prova a caricarlo di nuovo. |
kErrorCanceled |
L'utente ha annullato l'operazione. |
kErrorDownloadSizeExceeded |
Le dimensioni del file scaricato superano la quantità di memoria allocata per il download. Aumenta il limite di memoria e riprova a scaricare. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-08-16 UTC.
[null,null,["Ultimo aggiornamento 2025-08-16 UTC."],[],[],null,["# Handle errors with Cloud Storage for C++\n\n\u003cbr /\u003e\n\nSometimes when you're building an app, things don't go as planned and an\nerror occurs.\n\nWhen in doubt, check the error returned, and see what the error message says.\n| **Note:** By default, a Cloud Storage for Firebase bucket requires Firebase Authentication to perform any action on the bucket's data or files. You can change your Firebase Security Rules for Cloud Storage to [allow unauthenticated access for specific situations](/docs/storage/security/rules-conditions#public). However, for most situations, we strongly recommend [restricting access and setting up robust security rules](/docs/storage/security/get-started) (especially for production apps). Note that if you use Google App Engine and have a default Cloud Storage bucket with a name format of `*.appspot.com`, you may need to consider [how your security rules impact access to App Engine files](/docs/storage/gcp-integration#security-rules-and-app-engine-files).\n\nIf you've checked the error message and have Cloud Storage Security Rules that allow your\naction, but are still struggling to fix the error, visit our\n[Support page](/support) and let us know how we can help.\n\nHandle Error Messages\n---------------------\n\nThere are a number of reasons why errors may occur, including the file\nnot existing, the user not having permission to access the desired file, or the\nuser cancelling the file upload.\n\nTo properly diagnose the issue and handle the error, here is a full list of\nall the errors our client will raise, and how they can occur.\n\n| Name | Reason |\n|------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kErrorNone` | There was no error. |\n| `kErrorUnknown` | An unknown error occurred. |\n| `kErrorObjectNotFound` | No object exists at the specified reference. |\n| `kErrorBucketNotFound` | No bucket is configured for Cloud Storage. |\n| `kErrorProjectNotFound` | No project is configured for Cloud Storage. |\n| `kErrorQuotaExceeded` | Quota on your Cloud Storage bucket has been exceeded. If you're on the Spark pricing plan, consider upgrading to the [pay-as-you-go Blaze pricing plan](/pricing). If you're already on the Blaze pricing plan, reach out to Firebase Support. **Important** : Starting October 1, 2025, the [Blaze pricing plan will be *required* to use Cloud Storage](/docs/storage/faqs-storage-changes-announced-sept-2024), even default buckets. |\n| `kErrorUnauthenticated` | User is unauthenticated. Authenticate and try again. |\n| `kErrorUnauthorized` | User is not authorized to perform the requested action. Check your rules to ensure they are correct. |\n| `kErrorRetryLimitExceeded` | The maximum time limit on an operation (upload, download, delete, etc.) has been exceeded. Try uploading again. |\n| `kErrorNonMatchingChecksum` | File on the client does not match the checksum of the file received by the server. Try uploading again. |\n| `kErrorCanceled` | User canceled the operation. |\n| `kErrorDownloadSizeExceeded` | Size of the downloaded file exceeds the amount of memory allocated for the download. Increase memory cap and try downloading again. |"]]