Windows Phone 8.1 - Storage Exception?

What type of exception should be thrown when the phone runs out of storage space?

The closest I've found is called IsolatedStorageException , but I'm not sure if this is the correct option.

+3


source to share


1 answer


Your best method is probably just to use an I / O exception to do this. Actually there is already a SO Question regarding how to check if the error is that there is not enough space.

The main takeaway is to check the HResult of the exception to see if it is ERROR_DISK_FULL (0x70) or ERROR_HANDLE_DISK_FULL (0x27).



Another alternative would be to write a custom exception, overriding the IOException, checking the HResult, and then throwing the custom exception / handling it accordingly.

0


source







All Articles