瀏覽代碼

replaced ArgumentError with Exception for non severe cases

ashilkn 2 年之前
父節點
當前提交
bbaf75ce66

+ 3 - 3
lib/models/billing_plan.dart

@@ -18,7 +18,7 @@ class BillingPlans {
 
   factory BillingPlans.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw ArgumentError('argument is null');
+      throw Exception('Argument is null');
     }
 
     return BillingPlans(
@@ -53,7 +53,7 @@ class FreePlan {
 
   factory FreePlan.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw ArgumentError('argument is null');
+      throw Exception('Argument is null');
     }
 
     return FreePlan(
@@ -97,7 +97,7 @@ class BillingPlan {
 
   factory BillingPlan.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw ArgumentError('argument is null');
+      throw Exception('Argument is null');
     }
 
     return BillingPlan(

+ 1 - 1
lib/models/collection_file_item.dart

@@ -33,7 +33,7 @@ class CollectionFileItem {
 
   factory CollectionFileItem.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw ArgumentError('argument is null');
+      throw Exception('Argument is null');
     }
 
     return CollectionFileItem(

+ 3 - 3
lib/models/magic_metadata.dart

@@ -23,7 +23,7 @@ class MagicMetadata {
 
   factory MagicMetadata.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw Exception('argument is null');
+      throw Exception('Argument is null');
     }
     return MagicMetadata(
       visibility: map[magicKeyVisibility] ?? visibilityVisible,
@@ -45,7 +45,7 @@ class PubMagicMetadata {
 
   factory PubMagicMetadata.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw Exception('argument is null');
+      throw Exception('Argument is null');
     }
     return PubMagicMetadata(
       editedTime: map[pubMagicKeyEditedTime],
@@ -70,7 +70,7 @@ class CollectionMagicMetadata {
 
   factory CollectionMagicMetadata.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw Exception('argument is null');
+      throw Exception('Argument is null');
     }
     return CollectionMagicMetadata(
       visibility: map[magicKeyVisibility] ?? visibilityVisible,

+ 1 - 1
lib/models/subscription.dart

@@ -34,7 +34,7 @@ class Subscription {
 
   factory Subscription.fromMap(Map<String, dynamic>? map) {
     if (map == null) {
-      throw ArgumentError("argument is null");
+      throw Exception("Argument is null");
     }
     return Subscription(
       productID: map['productID'],