অ্যান্ড্রয়েডে ক্লাউড স্টোরেজের জন্য ত্রুটিগুলি পরিচালনা করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
কখনও কখনও জিনিসগুলি পরিকল্পনা অনুযায়ী যায় না এবং একটি ত্রুটি ঘটে।
সন্দেহ হলে, ফিরে আসা ত্রুটিটি পরীক্ষা করুন এবং ত্রুটি বার্তাটি কী বলে তা দেখুন৷ নিম্নলিখিত কোডটি একটি কাস্টম ত্রুটি হ্যান্ডলার বাস্তবায়ন দেখায় যা Cloud Storage দ্বারা প্রত্যাবর্তিত ত্রুটি কোড এবং ত্রুটি বার্তা পরিদর্শন করে৷ Cloud Storage API (উদাহরণস্বরূপ, UploadTask
এবং FileDownloadTask
) ব্যবহার করা বিভিন্ন অবজেক্টে এই ধরনের ত্রুটি হ্যান্ডলার যোগ করা যেতে পারে।
Kotlin
internal inner class MyFailureListener : OnFailureListener {
override fun onFailure(exception: Exception) {
val errorCode = (exception as StorageException).errorCode
val errorMessage = exception.message
// test the errorCode and errorMessage, and handle accordingly
}
}
Java
class MyFailureListener implements OnFailureListener {
@Override
public void onFailure(@NonNull Exception exception) {
int errorCode = ((StorageException) exception).getErrorCode();
String errorMessage = exception.getMessage();
// test the errorCode and errorMessage, and handle accordingly
}
}
আপনি যদি ত্রুটির বার্তাটি পরীক্ষা করে থাকেন এবং Cloud Storage Security Rules থাকে যা আপনার পদক্ষেপের অনুমতি দেয়, কিন্তু এখনও ত্রুটিটি ঠিক করতে সংগ্রাম করছে, তাহলে আমাদের সহায়তা পৃষ্ঠাতে যান এবং আমরা কীভাবে সাহায্য করতে পারি তা আমাদের জানান৷
ত্রুটি বার্তা পরিচালনা করুন
ফাইলটি বিদ্যমান না থাকা, ব্যবহারকারীর পছন্দসই ফাইল অ্যাক্সেস করার অনুমতি না থাকা বা ব্যবহারকারী ফাইল আপলোড বাতিল করা সহ ত্রুটিগুলি ঘটতে পারে এমন অনেকগুলি কারণ রয়েছে৷
সমস্যাটি সঠিকভাবে নির্ণয় করতে এবং ত্রুটিটি পরিচালনা করতে, আমাদের ক্লায়েন্ট যে সমস্ত ত্রুটিগুলি উত্থাপন করবে এবং সেগুলি কীভাবে ঘটতে পারে তার একটি সম্পূর্ণ তালিকা এখানে রয়েছে৷ এই টেবিলের ত্রুটি কোডগুলি StorageException
ক্লাসে পূর্ণসংখ্যা ধ্রুবক হিসাবে সংজ্ঞায়িত করা হয়েছে।
কোড | কারণ |
---|
ERROR_UNKNOWN | একটি অজানা ত্রুটি ঘটেছে. |
ERROR_OBJECT_NOT_FOUND | নির্দিষ্ট রেফারেন্সে কোন বস্তু বিদ্যমান নেই। |
ERROR_BUCKET_NOT_FOUND | Cloud Storage জন্য কোনো বালতি কনফিগার করা নেই |
ERROR_PROJECT_NOT_FOUND | Cloud Storage জন্য কোনো প্রজেক্ট কনফিগার করা নেই |
ERROR_QUOTA_EXCEEDED | আপনার Cloud Storage বাকেটের কোটা অতিক্রম করা হয়েছে। আপনি যদি স্পার্ক প্রাইসিং প্ল্যানে থাকেন, তাহলে পে-অ্যাজ-ইউ-গো ব্লেজ প্রাইসিং প্ল্যানে আপগ্রেড করার কথা বিবেচনা করুন। আপনি যদি ইতিমধ্যেই Blaze মূল্য নির্ধারণের পরিকল্পনায় থাকেন, তাহলে Firebase সহায়তার সাথে যোগাযোগ করুন।
গুরুত্বপূর্ণ : অক্টোবর 1, 2025 থেকে, Cloud Storage , এমনকি ডিফল্ট বালতি ব্যবহার করার জন্য Blaze মূল্য পরিকল্পনার প্রয়োজন হবে । |
ERROR_NOT_AUTHENTICATED | ব্যবহারকারী অননুমোদিত, অনুগ্রহ করে প্রমাণীকরণ করুন এবং আবার চেষ্টা করুন। |
ERROR_NOT_AUTHORIZED | ব্যবহারকারী অনুরোধকৃত ক্রিয়া সম্পাদনের জন্য অনুমোদিত নয়, সেগুলি সঠিক কিনা তা নিশ্চিত করতে আপনার নিয়মগুলি পরীক্ষা করুন৷ |
ERROR_RETRY_LIMIT_EXCEEDED | একটি অপারেশনের সর্বোচ্চ সময়সীমা (আপলোড, ডাউনলোড, মুছে ফেলা, ইত্যাদি) অতিক্রম করা হয়েছে৷ আবার চেষ্টা করুন |
ERROR_INVALID_CHECKSUM | ক্লায়েন্টের ফাইল সার্ভার দ্বারা প্রাপ্ত ফাইলের চেকসামের সাথে মেলে না। আবার আপলোড করার চেষ্টা করুন। |
ERROR_CANCELED | ব্যবহারকারী অপারেশন বাতিল করেছেন. |
উপরন্তু, একটি অবৈধ URL দিয়ে getReferenceFromUrl()
কল করার চেষ্টা করার ফলে একটি IllegalArgumentException
নিক্ষেপ করা হতে পারে। উপরের পদ্ধতির আর্গুমেন্ট gs://bucket/object
বা https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=<TOKEN>
ফর্মের হতে হবে
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-22 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-22 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["\u003cbr /\u003e\n\nSometimes things don't go as planned and an error occurs.\n\nWhen in doubt, check the error returned and see what the error message says.\nThe following code shows a custom error handler implementation that inspects\nthe error code and error message returned by Cloud Storage. Such error\nhandlers can be added to various objects used in the Cloud Storage API (for\nexample, `UploadTask` and `FileDownloadTask`). \n\nKotlin \n\n```kotlin\ninternal inner class MyFailureListener : OnFailureListener {\n override fun onFailure(exception: Exception) {\n val errorCode = (exception as StorageException).errorCode\n val errorMessage = exception.message\n // test the errorCode and errorMessage, and handle accordingly\n }\n}https://github.com/firebase/snippets-android/blob/391c1646eacf44d2aab3f76bcfa60dfc6c14acf1/storage/app/src/main/java/com/google/firebase/referencecode/storage/kotlin/StorageActivity.kt#L492-L498\n```\n\nJava \n\n```java\nclass MyFailureListener implements OnFailureListener {\n @Override\n public void onFailure(@NonNull Exception exception) {\n int errorCode = ((StorageException) exception).getErrorCode();\n String errorMessage = exception.getMessage();\n // test the errorCode and errorMessage, and handle accordingly\n }\n}https://github.com/firebase/snippets-android/blob/391c1646eacf44d2aab3f76bcfa60dfc6c14acf1/storage/app/src/main/java/com/google/firebase/referencecode/storage/StorageActivity.java#L618-L625\n```\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 all\nthe errors our client will raise, and how they can occur. Error codes in this\ntable are defined in the `StorageException` class as integer constants.\n\n| Code | Reason |\n|------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ERROR_UNKNOWN` | An unknown error occurred. |\n| `ERROR_OBJECT_NOT_FOUND` | No object exists at the specified reference. |\n| `ERROR_BUCKET_NOT_FOUND` | No bucket is configured for Cloud Storage |\n| `ERROR_PROJECT_NOT_FOUND` | No project is configured for Cloud Storage |\n| `ERROR_QUOTA_EXCEEDED` | 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| `ERROR_NOT_AUTHENTICATED` | User is unauthenticated, please authenticate and try again. |\n| `ERROR_NOT_AUTHORIZED` | User is not authorized to perform the requested action, check your rules to ensure they are correct. |\n| `ERROR_RETRY_LIMIT_EXCEEDED` | The maximum time limit on an operation (upload, download, delete, etc.) has been excceded. Try again. |\n| `ERROR_INVALID_CHECKSUM` | File on the client does not match the checksum of the file received by the server. Try uploading again. |\n| `ERROR_CANCELED` | User canceled the operation. |\n\nAdditionally, attempting to call `getReferenceFromUrl()` with an invalid URL\nwill result in an `IllegalArgumentException` from being thrown. The argument to\nthe above method must be of the form `gs://bucket/object` or\n`https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=\u003cTOKEN\u003e`"]]