Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Error Handling with Full Storage
Started by davidgmonical Aug 09 2018 11:08 AM

2 replies to this topic
storage error crash download network
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

davidgmonical

[GLOBAL: userInfoPane.html]
davidgmonical
  • Enthusiast

  • 77 posts
  • Corona SDK

I'm attempting to download .zip files in my app which can be fairly large (hundreds of MB). Testing on a device with full storage, I'm getting a crash on download.

 

*** Terminating app due to uncaught exception 'NSFileHandleOperationException', reason: '*** -[NSConcreteFileHandle writeData:]: No space left on device'

 

 

Rather than crashing, is it possible to detect this error and cancel the download? Or perhaps is there a way to check the storage left before the download?

 

Thanks a bunch,

David



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,838 posts
  • Corona Staff

There is a community plugin that will let you get the remaining free space:  https://marketplace.coronalabs.com/corona-plugins/more-info

 

Or you can use Corona native builds and code the space check using native APIs.

 

Rob



[TOPIC: post.html]
#3

davidgmonical

[GLOBAL: userInfoPane.html]
davidgmonical
  • Enthusiast

  • 77 posts
  • Corona SDK

Thanks Rob! I’ll check it out.


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: storage, error, crash, download, network