Cloud Storage for C++ でエラーを処理する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アプリをビルドする際、思いどおりにいかなかったり、エラーが発生したりすることがあります。
理由が不明な場合は、返されたエラーをチェックして、エラー メッセージの内容を確認します。
エラー メッセージをチェックし、Cloud Storage Security Rules で操作を許可した後でもエラーを解決できない場合は、サポートページにアクセスしてお問い合わせください。
エラー メッセージを処理する
エラーが発生する理由として、ファイルが存在しない、目的のファイルのアクセス権がユーザーにない、ユーザーがファイルのアップロードをキャンセルしたなど、たくさんの理由が考えられます。
問題を適切に診断してエラーを処理するには、クライアントで発生するすべてのエラーとその発生理由について説明した以下の全一覧をご覧ください。
名前 |
理由 |
kErrorNone |
エラーが発生しませんでした。 |
kErrorUnknown |
不明なエラーが発生しました。 |
kErrorObjectNotFound |
特定の参照にオブジェクトが存在しません。 |
kErrorBucketNotFound |
Cloud Storage 用のバケットが構成されていません。 |
kErrorProjectNotFound |
Cloud Storage 用のプロジェクトが構成されていません。 |
kErrorQuotaExceeded |
Cloud Storage バケットの割り当てを超えました。Spark 料金プランをご利用の場合は、従量課金制の Blaze 料金プランへのアップグレードを検討してください。すでに Blaze 料金プランをご利用の場合は、Firebase サポートまでお問い合わせください。
重要: 2025 年 10 月 1 日より、デフォルト バケットでも Cloud Storage を使用するには、Blaze 料金プランが必要になります。 |
kErrorUnauthenticated |
認証されていないユーザーです。認証してから、もう一度お試しください。 |
kErrorUnauthorized |
要求された操作を行う権限がユーザーにありません。ルールが正しいことをご確認ください。 |
kErrorRetryLimitExceeded |
操作(アップロード、ダウンロード、削除など)の最大時間制限を超えました。もう一度アップロードしてみてください。 |
kErrorNonMatchingChecksum |
クライアント上のファイルが、サーバーで受信されたファイルのチェックサムと一致しません。もう一度アップロードしてみてください。 |
kErrorCanceled |
ユーザーが操作をキャンセルしました。 |
kErrorDownloadSizeExceeded |
ダウンロード ファイルのサイズが、ダウンロード用に割り当てられているメモリ量を超えています。メモリ容量を増やし、もう一度ダウンロードしてみてください。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-16 UTC。
[null,null,["最終更新日 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. |"]]