@@ -156,6 +156,7 @@ func _check_emulating() -> void :
156
156
157
157
func _upload (data : PackedByteArray , headers : PackedStringArray , ref : StorageReference , meta_only : bool ) -> Variant :
158
158
if _is_invalid_authentication ():
159
+ Firebase ._printerr ("Error uploading to storage: Invalid authentication" )
159
160
return 0
160
161
161
162
var task := StorageTask .new ()
@@ -169,6 +170,7 @@ func _upload(data : PackedByteArray, headers : PackedStringArray, ref : StorageR
169
170
170
171
func _download (ref : StorageReference , meta_only : bool , url_only : bool ) -> Variant :
171
172
if _is_invalid_authentication ():
173
+ Firebase ._printerr ("Error downloading from storage: Invalid authentication" )
172
174
return 0
173
175
174
176
var info_task := StorageTask .new ()
@@ -204,6 +206,7 @@ func _download(ref : StorageReference, meta_only : bool, url_only : bool) -> Var
204
206
205
207
func _list (ref : StorageReference , list_all : bool ) -> Array :
206
208
if _is_invalid_authentication ():
209
+ Firebase ._printerr ("Error getting object list from storage: Invalid authentication" )
207
210
return []
208
211
209
212
var task := StorageTask .new ()
@@ -215,6 +218,7 @@ func _list(ref : StorageReference, list_all : bool) -> Array:
215
218
216
219
func _delete (ref : StorageReference ) -> bool :
217
220
if _is_invalid_authentication ():
221
+ Firebase ._printerr ("Error deleting object from storage: Invalid authentication" )
218
222
return false
219
223
220
224
var task := StorageTask .new ()
@@ -270,6 +274,8 @@ func _finish_request(result : int) -> void:
270
274
271
275
StorageTask .Task .TASK_DOWNLOAD_URL :
272
276
var json = Utilities .get_json_data (_response_data )
277
+ if json != null and json .has ("error" ):
278
+ Firebase ._printerr ("Error getting object download url: " + json ["error" ].message )
273
279
if json != null and json .has ("downloadTokens" ):
274
280
task .data = _base_url + _get_file_url (task .ref ) + "?alt=media&token=" + json .downloadTokens
275
281
else :
@@ -278,6 +284,8 @@ func _finish_request(result : int) -> void:
278
284
StorageTask .Task .TASK_LIST , StorageTask .Task .TASK_LIST_ALL :
279
285
var json = Utilities .get_json_data (_response_data )
280
286
var items := []
287
+ if json != null and json .has ("error" ):
288
+ Firebase ._printerr ("Error getting data from storage: " + json ["error" ].message )
281
289
if json != null and json .has ("items" ):
282
290
for item in json .items :
283
291
var item_name : String = item .name
0 commit comments