nativescript-imagepicker
nativescript-imagepicker copied to clipboard
[android]error not easy to "filter"
On android if you open the picker and then hit back, the promise will reject here There are 2 errors there:
- it should not reject in a sense. It should simply return no file selected (empty array). This is not an error
- seeing you return an error it means i need to filter it. Because my use won't care about
Image picker activity result code 0;)
So the first thing is that your error should be easier to filter. Maybe a custom Error with a status code property? And would you consider not rejecting on user just going back?
0 is the standard activity result for a cancelled operation. https://developer.android.com/reference/android/app/Activity#RESULT_CANCELED
But I agree that the result code could be a property of the error.