Obsługa błędów w Cloud Storage dla C++
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Czasami podczas tworzenia aplikacji coś idzie nie tak i występuje błąd.
W razie wątpliwości sprawdź zwrócony błąd i zapoznaj się z komunikatem o błędzie.
Jeśli po sprawdzeniu komunikatu o błędzie masz Cloud Storage Security Rules, które umożliwiają wykonanie działania, ale nadal nie możesz rozwiązać problemu, odwiedź naszą stronę pomocy i poinformuj nas, jak możemy Ci pomóc.
Obsługa komunikatów o błędach
Błędy mogą wystąpić z różnych powodów, np. z powodu braku pliku, braku uprawnień użytkownika do dostępu do wybranego pliku lub anulowania przez użytkownika przesyłania pliku.
Aby prawidłowo zdiagnozować problem i obsłużyć błąd, zapoznaj się z pełną listą wszystkich błędów, które może zgłosić nasz klient, oraz z informacjami o tym, jak mogą one wystąpić.
Nazwa |
Przyczyna |
kErrorNone |
Nie było żadnego błędu. |
kErrorUnknown |
Wystąpił nieznany błąd. |
kErrorObjectNotFound |
W określonym odwołaniu nie ma obiektu. |
kErrorBucketNotFound |
Dla Cloud Storage nie skonfigurowano żadnego zasobnika. |
kErrorProjectNotFound |
Dla Cloud Storage nie skonfigurowano żadnego projektu. |
kErrorQuotaExceeded |
Przekroczono limit w przypadku zasobnika Cloud Storage. Jeśli korzystasz z abonamentu Spark, rozważ przejście na abonament Blaze z płatnością za wykorzystanie. Jeśli korzystasz już z abonamentu Blaze, skontaktuj się z zespołem pomocy Firebase.
Ważne: od 1 października 2025 r. do korzystania z Cloud Storage, nawet z domyślnych zasobników, będzie wymagany abonament Blaze. |
kErrorUnauthenticated |
Użytkownik nie jest uwierzytelniony. Uwierzytelnij się i spróbuj ponownie. |
kErrorUnauthorized |
Użytkownik nie ma uprawnień do wykonania żądanego działania. Sprawdź, czy reguły są prawidłowe. |
kErrorRetryLimitExceeded |
Przekroczono maksymalny limit czasu operacji (przesyłania, pobierania, usuwania itp.). Spróbuj przesłać jeszcze raz. |
kErrorNonMatchingChecksum |
Plik na urządzeniu klienta nie jest zgodny z sumą kontrolną pliku otrzymanego przez serwer. Spróbuj przesłać jeszcze raz. |
kErrorCanceled |
Operacja anulowana przez użytkownika. |
kErrorDownloadSizeExceeded |
Rozmiar pobranego pliku przekracza ilość pamięci przydzielonej na pobieranie. Zwiększ limit pamięci i spróbuj pobrać ponownie. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-16 UTC.
[null,null,["Ostatnia aktualizacja: 2025-08-16 UTC."],[],[],null,["\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\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. |"]]