nativescript-imagepicker icon indicating copy to clipboard operation
nativescript-imagepicker copied to clipboard

[android]error not easy to "filter"

Open farfromrefug opened this issue 5 years ago • 1 comments

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?

farfromrefug avatar Mar 30 '20 08:03 farfromrefug

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.

SpurguX avatar Aug 05 '21 09:08 SpurguX